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-10 of 14 results. Next

A055012 Sum of cubes of the digits of n written in base 10.

Original entry on oeis.org

0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1, 2, 9, 28, 65, 126, 217, 344, 513, 730, 8, 9, 16, 35, 72, 133, 224, 351, 520, 737, 27, 28, 35, 54, 91, 152, 243, 370, 539, 756, 64, 65, 72, 91, 128, 189, 280, 407, 576, 793, 125, 126, 133, 152, 189, 250, 341, 468, 637, 854
Offset: 0

Views

Author

Henry Bottomley, May 31 2000

Keywords

Comments

For n > 1999, a(n) < n. The iteration of this map on n either stops at a fixed point (A046197) or has a period of 2 or 3: {55,250,133}, {136,244}, {160,217,352}, or {919,1459}. - T. D. Noe, Jul 17 2007
A165330 and A165331 give the final value and the number of steps when iterating until a fixed point or cycle is reached. - Reinhard Zumkeller, Sep 17 2009

Crossrefs

Cf. A046197 Fixed points; A046459: integers equal to the sum of the digits of their cubes; A072884: 3rd-order digital invariants: the sum of the cubes of the digits of n equals some number k and the sum of the cubes of the digits of k equals n; A164883: cubes with the property that the sum of the cubes of the digits is also a cube.

Programs

  • Magma
    [0] cat [&+[d^3: d in Intseq(n)]: n in [1..60]]; // Bruno Berselli, Feb 01 2013
    
  • Maple
    A055012 := proc(n)
            add(d^3,d=convert(n,base,10)) ;
    end proc: # R. J. Mathar, Dec 15 2011
  • Mathematica
    Total/@((IntegerDigits/@Range[0,60])^3) (* Harvey P. Dale, Jan 27 2012 *)
    Table[Sum[DigitCount[n][[i]] i^3, {i, 9}], {n, 0, 60}] (* Bruno Berselli, Feb 01 2013 *)
  • PARI
    A055012(n)=sum(i=1,#n=digits(n),n[i]^3) \\ Charles R Greathouse IV, Jul 01 2013
    
  • Python
    def a(n): return sum(map(lambda x: x*x*x, map(int, str(n))))
    print([a(n) for n in range(60)]) # Michael S. Branicky, Jul 13 2022

Formula

a(n) = Sum_{k>=1} (floor(n/10^k) - 10*floor(n/10^(k+1)))^3. - Hieronymus Fischer, Jun 25 2007
a(10n+k) = a(n) + k^3, 0 <= k < 10. - Hieronymus Fischer, Jun 25 2007
From Reinhard Zumkeller, Sep 17 2009: (Start)
a(n) <= 729*A055642(n);
a(A165370(n)) = n and a(m) <> n for m < A165370(n);
a(A031179(n)) = A031179(n);
a(a(A165336(n))) = A165336(n) or a(a(a(A165336(n)))) = A165336(n). (End)
G.f. g(x) = Sum_{k>=0} (1-x^(10^k))*(x^(10^k)+8*x^(2*10^k)+27*x^(3*10^k)+64*x^(4*10^k)+125*x^(5*10^k)+216*x^(6*10^k)+343*x^(7*10^k)+512*x^(8*10^k)+729*x^(9*10^k))/((1-x)*(1-x^(10^(k+1))))
satisfies
g(x) = (x+8*x^2+27*x^3+64*x^4+125*x^5+216*x^6+343*x^7+512*x^8+729*x^9)/(1-x^10) + (1-x^10)*g(x^10)/(1-x). - Robert Israel, Jan 26 2017

Extensions

Edited by M. F. Hasler, Apr 12 2015
Iséki and Stewart links added by Don Knuth, Sep 07 2015

A152147 Irregular triangle in which row n lists k > 0 such that the sum of digits of k^n equals k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 9, 1, 8, 17, 18, 26, 27, 1, 7, 22, 25, 28, 36, 1, 28, 35, 36, 46, 1, 18, 45, 54, 64, 1, 18, 27, 31, 34, 43, 53, 58, 68, 1, 46, 54, 63, 1, 54, 71, 81, 1, 82, 85, 94, 97, 106, 117, 1, 98, 107, 108, 1, 108, 1, 20, 40, 86, 103, 104, 106, 107, 126, 134, 135
Offset: 1

Views

Author

T. D. Noe, Nov 26 2008

Keywords

Comments

Each row begins with 1 and has length A046019(n).

Examples

			1, 2, 3, 4, 5, 6, 7, 8, 9;
1, 9;
1, 8, 17, 18, 26, 27;              (A046459, with 0)
1, 7, 22, 25, 28, 36;              (A055575    "   )
1, 28, 35, 36, 46;                 (A055576    "   )
1, 18, 45, 54, 64;                 (A055577    "   )
1, 18, 27, 31, 34, 43, 53, 58, 68; (A226971    "   )
1, 46, 54, 63;
1, 54, 71, 81,
1, 82, 85, 94, 97, 106, 117,
1, 98, 107, 108, etc.
		

Crossrefs

Programs

  • Python
    def ok(k, r): return sum(map(int, str(k**r))) == k
    def agen(rows, startrow=1, withzero=0):
      for r in range(startrow, rows + startrow):
        d, lim = 1, 1
        while lim < r*9*d: d, lim = d+1, lim*10
        yield from [k for k in range(1-withzero, lim+1) if ok(k, r)]
    print([an for an in agen(13)]) # Michael S. Branicky, May 23 2021

A046017 Least k > 1 with k = sum of digits of k^n, or 0 if no such k exists.

Original entry on oeis.org

2, 9, 8, 7, 28, 18, 18, 46, 54, 82, 98, 108, 20, 91, 107, 133, 80, 172, 80, 90, 90, 90, 234, 252, 140, 306, 305, 90, 305, 396, 170, 388, 170, 387, 378, 388, 414, 468, 449, 250, 432, 280, 461, 280, 360, 360, 350, 370, 270, 685, 360, 625, 648, 370, 677, 684, 370, 667, 370, 694, 440, 855, 827, 430, 818
Offset: 1

Views

Author

Keywords

Comments

First non-occurrence happens with exponent 105. There is no x such that sum-of-digits{x^105}=x (x>1). - Patrick De Geest, Aug 15 1998

Examples

			a(3) = 8 since 8^3 = 512 and 5+1+2 = 8; a(5) = 28 because 28 is least number > 1 with 28^5 = 17210368, 1+7+2+1+0+3+6+8 = 28. 53^7 = 1174711139837 -> 1+1+7+4+7+1+1+1+3+9+8+3+7 = 53.
a(10) = 82 because 82^10 = 13744803133596058624 and 1 + 3 + 7 + 4 + 4 + 8 + 0 + 3 + 1 + 3 + 3 + 5 + 9 + 6 + 0 + 5 + 8 + 6 + 2 + 4 = 82.
a(13) = 20: 20^13=81920000000000000, 8+1+9+2=20.
a(17) = 80: 80^17=225179981368524800000000000000000, 2+2+5+1+7+9+9+8+1+3+6+8+5+2+4+8 = 80.
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 208-210.
  • Joe Roberts, "Lure of the Integers", The Mathematical Association of America, 1992, p. 172.

Crossrefs

Cf. A133509 (n for which a(n)=0), A152147 (table of k for each n).

Programs

  • Mathematica
    a[n_] := For[k = 2, k <= 20*n, k++, Which[k == Total[IntegerDigits[k^n]], Return[k], k == 20*n, Return[0]]]; Table[a[n] , {n, 1, 105}] (* Jean-François Alcover, May 23 2012 *)
    sdk[n_]:=Module[{k=2},While[k!=Total[IntegerDigits[k^n]],k++];k]; Array[sdk,70] (* Harvey P. Dale, Jan 07 2024 *)
  • Python
    from itertools import chain
    def c(k, n): return sum(map(int, str(k**n))) == k
    def a(n):
        if n == 0: return False
        d, lim = 1, 1
        while lim < n*9*d: d, lim = d+1, lim*10
        m = next(k for k in chain(range(2, lim+1), (0,)) if c(k, n))
        return m
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Jul 06 2022

Extensions

More terms from Asher Auel, Jun 01 2000

A055575 Sum of digits of n^4 is equal to n.

Original entry on oeis.org

0, 1, 7, 22, 25, 28, 36
Offset: 1

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			7 is a member because 7^4 = 2401 and 2+4+0+1 = 7.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..50] | &+Intseq(n^4) eq n ]; // Vincenzo Librandi, Feb 23 2015
    
  • Mathematica
    Select[Range[0, 50], #==Total[IntegerDigits[#^4]] &] (* Vincenzo Librandi, Feb 23 2015 *)
  • PARI
    isok(k)=sumdigits(k^4)==k \\ Patrick De Geest, Dec 10 2024
  • Sage
    [n for n in (0..50) if sum((n^4).digits()) == n] # Bruno Berselli, Feb 23 2015
    

A055576 Sum of digits of a(n)^5 is equal to a(n).

Original entry on oeis.org

0, 1, 28, 35, 36, 46
Offset: 1

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			a(2) = 28 because 28^5 = 17210368 and 1+7+2+1+0+3+6+8 = 28
		

Crossrefs

Programs

  • Magma
    [n: n in [0..50] | &+Intseq(n^5) eq n ]; // Vincenzo Librandi, Feb 23 2015
  • Mathematica
    Select[Range[0, 60], #==Total[IntegerDigits[#^5]] &] (* Vincenzo Librandi, Feb 23 2015 *)
  • PARI
    lista(nn) = {for (n=0, nn, if (n^5 == sumdigits(n^5)^5, print1(n, ", ")););} \\ Michel Marcus, Feb 23 2015
    

Extensions

Offset changed to 1 by Michel Marcus, Feb 23 2015

A055577 Numbers k such that the sum of digits of k^6 is equal to k.

Original entry on oeis.org

0, 1, 18, 45, 54, 64
Offset: 1

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			a(2) = 18 because 18^6 = 34012224 and 3+4+0+1+2+2+2+4 = 18
		

Crossrefs

Programs

  • Magma
    [n: n in [0..100] | &+Intseq(n^6) eq n ]; // Vincenzo Librandi, Feb 23 2015
    
  • Mathematica
    Select[Range[0,100],#==Total[IntegerDigits[#^6]]&] (* Harvey P. Dale, Oct 26 2011 *)
  • PARI
    isok(k)=sumdigits(k^6)==k \\ Patrick De Geest, Dec 13 2024
  • Sage
    [n for n in (0..70) if sum((n^6).digits()) == n] # Bruno Berselli, Feb 23 2015
    

A046000 a(n) is the largest number m equal to the sum of digits of m^n.

Original entry on oeis.org

1, 9, 9, 27, 36, 46, 64, 68, 63, 81, 117, 108, 108, 146, 154, 199, 187, 216, 181, 207, 207, 225, 256, 271, 288, 337, 324, 307, 328, 341, 396, 443, 388, 423, 463, 477, 424, 495, 469, 523, 502, 432, 531, 572, 603, 523, 592, 666, 667, 695, 685, 685, 739, 746, 739, 683, 684, 802, 754, 845, 793, 833, 865
Offset: 0

Views

Author

David W. Wilson and Patrick De Geest

Keywords

Comments

Cases a(n) = 1 begin: 0, 105, 164, 186, 194, 206, 216, 231, 254, 282, 285, ... Cf. A133509. - Jean-François Alcover, Jan 09 2018

Examples

			a(3) = 27 because 27 is the largest number with 27^3 = 19683 and 1+9+6+8+3 = 27.
a(5) = 46 because 46 is the largest number with 46^5 = 205962976 and 2+0+5+9+6+2+9+7+6 = 46.
		

References

  • Amarnath Murthy, The largest and the smallest m-th power whose digits sum /product is its m-th root. To appear in Smarandache Notions Journal, 2003.
  • Amarnath Murthy, e-book, "Ideas on Smarandache Notions" MS.LIT
  • Joe Roberts, "Lure of the Integers", The Mathematical Association of America, 1992, p. 172.

Crossrefs

Programs

  • Mathematica
    meanDigit = 9/2; translate = 900; upperm[1] = translate;
    upperm[n_] := Exp[-ProductLog[-1, -Log[10]/(meanDigit*n)]] + translate;
    (* assuming that upper bound of m fits the implicit curve m = Log[10, m^n]*9/2 *)
    a[0] = 1; a[n_] := (For[max = m = 0, m <= upperm[n], m++, If[m == Total[IntegerDigits[m^n]], max = m]]; max);
    Table[a[n], {n, 0, 1000}] (* Jean-François Alcover, Jan 09 2018, updated Jul 07 2022 *)
  • Python
    def ok(k, n): return sum(map(int, str(k**n))) == k
    def a(n):
        d, lim = 1, 1
        while lim < n*9*d: d, lim = d+1, lim*10
        return next(k for k in range(lim, 0, -1) if ok(k, n))
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jul 06 2022

Formula

a(n) = A061211(n)^(1/n), for n > 0.

Extensions

More terms from Asher Auel, Jun 01 2000
More terms from Franklin T. Adams-Watters, Sep 01 2006
Edited by N. J. A. Sloane at the suggestion of David Wasserman, Dec 12 2007

A046471 Number of numbers k>1 such that k equals the sum of digits in k^n.

Original entry on oeis.org

8, 1, 5, 5, 4, 4, 8, 3, 3, 6, 3, 1, 11, 5, 7, 6, 4, 2, 9, 3, 3, 7, 3, 3, 13, 4, 2, 6, 5, 1, 10, 1, 7, 3, 5, 2, 8, 2, 2, 6, 1, 4, 9, 5, 3, 8, 8, 4, 11, 1, 3, 4, 4, 5, 2, 1, 6, 3, 4, 4, 5, 2, 3, 4, 4, 3, 8, 1, 5, 3, 2, 2, 5, 4, 5, 3, 3, 4, 8, 4, 2, 4, 4, 1, 5, 2, 6, 6, 3, 2, 7, 3, 3, 8, 5, 1, 7, 1, 4, 5, 2, 3, 9
Offset: 1

Views

Author

Patrick De Geest, Aug 15 1998

Keywords

Comments

The number of digits in k^n is at most 1+n*log(k). Hence the maximum sum of digits of k^n is 9(1+n*log(k)). By solving k=9(1+n*log(k)), we can compute an upper bound on k for each n. Sequence A133509 lists the n for which a(n)=0.

Examples

			a(17)=4 -> sum-of-digits{x^17}=x for x=80,143,171 and 216 (x>1).
		

References

  • Joe Roberts, "Lure of the Integers", The Mathematical Association of America, 1992, p. 172.

Crossrefs

a(n) = A046019(n) - 1.
Cf. A152147 (table of k such that the sum of digits of k^n equals k)

Extensions

Edited by T. D. Noe, Nov 25 2008

A055569 Sum of digits of a(n)^3 is greater than or equal to a(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 26, 27
Offset: 0

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			a(4) = 4 because 4^3 = 64 and 6+4 = 10>= 4
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300],Total[IntegerDigits[#^3]]>=#&] (* Harvey P. Dale, Aug 27 2013 *)

A225534 Numbers whose sum of cubed digits is prime.

Original entry on oeis.org

11, 101, 110, 111, 113, 115, 122, 124, 128, 131, 139, 142, 146, 148, 151, 155, 164, 166, 182, 184, 193, 199, 212, 214, 218, 221, 223, 227, 232, 236, 238, 241, 245, 254, 256, 263, 265, 269, 272, 278, 281, 283, 287, 289, 296, 298, 311, 319, 322, 326, 328, 335
Offset: 1

Views

Author

Keywords

Comments

Note that 11 is the only two-digit number in the sequence.
a(n) ~ n. For 414 < n < 10000, 6.38*n - 528 provides an estimate of a(n) to within 6%.

Examples

			139 is in the sequence because 1^3 + 3^3 + 9^3 = 757, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[350],PrimeQ[Total[IntegerDigits[#]^3]]&] (* Harvey P. Dale, Mar 16 2016 *)
  • R
    digcubesum<-function(x) sum(as.numeric(strsplit(as.character(x),split="")[[1]])^3); library(gmp);
    which(sapply(1:1000,function(x) isprime(digcubesum(x))>0))
Showing 1-10 of 14 results. Next