OFFSET
0,3
COMMENTS
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..10000
N. J. A. Sloane, Confessions of a Sequence Addict (AofA2017), slides of invited talk given at AofA 2017, Jun 19 2017, Princeton. Mentions this sequence.
EXAMPLE
20 -> 2^0 = 1,
21 -> 2^1 = 2,
24 -> 2^4 = 16,
39 -> 3^9 = 19683,
623 -> 6^2*3 = 108,
etc.
MAPLE
powertrain:=proc(n) local a, i, n1, n2, t1, t2; n1:=abs(n); n2:=sign(n); t1:=convert(n1, base, 10); t2:=nops(t1); a:=1; for i from 0 to floor(t2/2)-1 do a := a*t1[t2-2*i]^t1[t2-2*i-1]; od: if t2 mod 2 = 1 then a:=a*t1[1]; fi; RETURN(n2*a); end; # N. J. A. Sloane, Dec 03 2007
MATHEMATICA
ptm[n_]:=Module[{idn=IntegerDigits[n]}, If[EvenQ[Length[idn]], Times@@( #[[1]]^ #[[2]] &/@Partition[idn, 2]), (Times@@(#[[1]]^#[[2]] &/@ Partition[ Most[idn], 2]))Last[idn]]]; Array[ptm, 70, 0] (* Harvey P. Dale, Jul 15 2019 *)
PROG
(Haskell)
a133500 = train . reverse . a031298_row where
train [] = 1
train [x] = x
train (u:v:ws) = u ^ v * (train ws)
-- Reinhard Zumkeller, May 27 2013
(Python)
def A133500(n):
s = str(n)
l = len(s)
m = int(s[-1]) if l % 2 else 1
for i in range(0, l-1, 2):
m *= int(s[i])**int(s[i+1])
return m # Chai Wah Wu, Jun 16 2017
CROSSREFS
KEYWORD
AUTHOR
J. H. Conway, Dec 03 2007
STATUS
approved