A133500 The powertrain or power train map: Powertrain(n): if abcd... is the decimal expansion of a number n, then the powertrain of n is the number n' = a^b*c^d* ..., which ends in an exponent or a base according as the number of digits is even or odd. a(0) = 0 by convention.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 1, 6, 36, 216, 1296
Offset: 0
Examples
20 -> 2^0 = 1, 21 -> 2^1 = 2, 24 -> 2^4 = 16, 39 -> 3^9 = 19683, 623 -> 6^2*3 = 108, etc.
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.
- N. J. A. Sloane, Three (No, 8) Lovely Problems from the OEIS, Experimental Mathematics Seminar, Rutgers University, Oct 05 2017, Part I, Part 2, Slides. (Mentions this sequence)
Crossrefs
Programs
-
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
-
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 *)
-
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
Comments