cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

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.

Original entry on oeis.org

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

Views

Author

J. H. Conway, Dec 03 2007

Keywords

Comments

We take 0^0 = 1.
The fixed points are in A135385.
For 1-digit or 2-digit numbers this is the same as A075877. - R. J. Mathar, Mar 28 2012
a(A221221(n)) = A133048(A221221(n)) = A222493(n). - Reinhard Zumkeller, May 27 2013

Examples

			20 -> 2^0 = 1,
21 -> 2^1 = 2,
24 -> 2^4 = 16,
39 -> 3^9 = 19683,
623 -> 6^2*3 = 108,
etc.
		

Crossrefs

Cf. A075877, A133501 (number of steps to reach fixed point), A133502, A135385 (the conjectured list of fixed points), A135384 (numbers which converge to 2592). For records see A133504, A133505; for the fixed points that are reached when this map is iterated starting at n, see A287877.
Cf. also A133048 (powerback), A031346 and A003001 (persistence).
Cf. also A031298, A007376.

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

A133048 Powerback(n): reverse the decimal expansion of n, drop any leading zeros, then apply the powertrain map of A133500 to the resulting number.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 1, 4, 9, 16, 25, 36, 49, 64, 81, 3, 1, 8, 27, 64, 125, 216, 343, 512, 729, 4, 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 5, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 6, 1, 64, 729, 4096, 15625, 46656, 117649
Offset: 0

Views

Author

J. H. Conway and N. J. A. Sloane, Dec 31 2007

Keywords

Comments

a(A221221(n)) = A133500(A221221(n)) = A222493(n). - Reinhard Zumkeller, May 27 2013

Examples

			E.g. 240 -> (0)42 -> 4^2 = 16; 12345 -> 54321 -> 5^4*3^2*1 = 5625.
		

Crossrefs

Cf. A131571 (fixed points), A133059 and A133134 (records); A133500 (powertrain).
Cf. A133144 (length of trajectory), A031346 and A003001 (persistence).
Cf. A031298.

Programs

  • Haskell
    a133048 0 = 0
    a133048 n = train $ dropWhile (== 0) $ a031298_row n where
       train []       = 1
       train [x]      = x
       train (u:v:ws) = u ^ v * (train ws)
    -- Reinhard Zumkeller, May 27 2013
  • Maple
    powerback:=proc(n) local a,i,j,t1,t2,t3;
    if n = 0 then RETURN(0); fi;
    t1:=convert(n, base, 10); t2:=nops(t1);
    for i from 1 to t2 do if t1[i] > 0 then break; fi; od:
    a:=1; t3:=t2-i+1;
    for j from 0 to floor(t3/2)-1 do a := a*t1[i+2*j]^t1[i+2*j+1]; od:
    if t3 mod 2 = 1 then a:=a*t1[t2]; fi;
    RETURN(a); end;
  • Mathematica
    ptm[n_]:=Module[{idn=IntegerDigits[IntegerReverse[n]]},If[ EvenQ[ Length[idn]],Times@@ (#[[1]]^#[[2]]&/@Partition[idn,2]),(Times@@(#[[1]]^#[[2]]&/@Partition[ Most[ idn],2]))Last[idn]]];Array[ptm,70,0] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 05 2020 *)

A221221 Where powerbacks and powertrains coincide.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 22, 24, 33, 42, 44, 55, 66, 77, 88, 99, 101, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 131, 141, 151, 161, 171, 181, 191, 202, 211, 212, 213, 214, 215, 216, 217, 218, 219, 222, 232, 242, 252, 262, 272, 282, 292
Offset: 1

Views

Author

Reinhard Zumkeller, May 27 2013

Keywords

Comments

Numbers m such that A133048(m) = A133500(m);
A133500(a(n)) = A133048(a(n)) = A222493(n);
if m is a term then also its reversal in decimal representation, palindromes are a subsequence, cf. A004086, A002113.

Examples

			Some non-palindromic terms:
a(11) = 10: A133500(10) = 1^0 = 1 = A133048(10) = A133048(1) = 1;
a(14) = 24: A133500(24) = 2^4 = 16 = A133048(24) = 4^2;
a(16) = 42: A133500(42) = 4^2 = 16 = A133048(42) = 2^4;
a(25) = 112: A133500(112) = 1^1 * 2 = 2 = A133048(112) = 2^1 * 1;
a(26) = 113: A133500(113) = 1^1 * 3 = 3 = A133048(113) = 3^1 * 1;
a(44) = 213: A133500(213) = 2^1 * 3 = 6 = A133048(213) = 3^1 * 2.
		

Programs

  • Haskell
    a221221 n = a221221_list !! (n-1)
    a221221_list = filter (\x -> a133500 x == a133048 x) [0..]
Showing 1-3 of 3 results.