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-5 of 5 results.

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

A046019 a(n) gives the number of different powers m^n for which the sum of the digits is equal to m.

Original entry on oeis.org

1, 9, 2, 6, 6, 5, 5, 9, 4, 4, 7, 4, 2, 12, 6, 8, 7, 5, 3, 10, 4, 4, 8, 4, 4, 14, 5, 3, 7, 6, 2, 11, 2, 8, 4, 6, 3, 9, 3, 3, 7, 2, 5, 10, 6, 4, 9, 9, 5, 12, 2, 4, 5, 5, 6, 3, 2, 7, 4, 5, 5, 6, 3, 4, 5, 5, 4, 9, 2, 6, 4, 3, 3, 6, 5, 6, 4, 4, 5, 9, 5, 3, 5, 5, 2, 6, 3, 7, 7, 4, 3, 8, 4, 4, 9, 6, 2, 8, 2, 5, 6, 3
Offset: 0

Views

Author

Keywords

Comments

Number of m >= 1 with m = sum of digits of m^n.

Examples

			a(7)=9 because:
1^7=1
18^7= 612220032 and 6+1+2+2+2+3+2=18
27^7= 10460353203 and 1+4+6+3+5+3+2+3=27
31^7= 27512614111 and 2+7+5+1+2+6+1+4+1+1+1=31
34^7= 52523350144 and 5+2+5+2+3+3+5+1+4+4=34
43^7= 271818611107 and 2+7+1+8+1+8+6+1+1+1+7=43
53^7= 1174711139837 and 1+1+7+4+7+1+1+1+3+9+8+3+7=53
58^7= 2207984167552 and 2+2+7+9+8+4+1+6+7+5+5+2=58
68^7= 6722988818432 and 6+7+2+2+9+8+8+8+1+8+4+3+2=68
a(9)=4 because:
1^9=1
54^9=3904305912313344 and 3+9+4+3+5+9+1+2+3+1+3+3+4+4=54
71^9=45848500718449031 and 4+5+8+4+8+5+7+1+8+4+4+9+3+1=71
81^9=150094635296999121 and 1+5+9+4+6+3+5+2+9+6+9+9+9+1+2+1=81
		

Crossrefs

Cf. A124359, A152147 (table of m such that the sum of digits of m^n equals m)

Formula

a(n) = 1 + A046471(n). - T. D. Noe, Nov 26 2008

Extensions

Examples provided by Paolo P. Lava, Oct 30 2006
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 27 2007

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

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

A133509 Numbers k such that m=1 is the only number for which the sum of digits of m^k equals m.

Original entry on oeis.org

0, 105, 164, 186, 194, 206, 216, 231, 254, 282, 285, 302, 314, 324, 374, 386, 402, 416, 456, 468, 491, 504, 521, 552, 588, 606, 610, 615, 629, 651, 656, 657, 696, 759, 794, 830, 842, 854, 870, 903, 906, 954, 956, 981, 998, 1029, 1064, 1079, 1082, 1109, 1112, 1131
Offset: 1

Views

Author

Farideh Firoozbakht, Dec 04 2007

Keywords

Crossrefs

Programs

  • Python
    def ok(n):
        d, lim = 1, 1
        while lim < n*9*d: d, lim = d+1, lim*10
        return not any(sum(map(int, str(k**n))) == k for k in range(2, lim+1))
    for k in range(195):
        if ok(k): print(k, end=", ") # Michael S. Branicky, Jul 06 2022

Formula

If t is a term, A046000(t)=1, A046017(t)=0, A046019(t)=1, A046471(t)=0 and A061211(t)=1. - Mohammed Yaseen, Jun 29 2022

Extensions

Description improved by T. D. Noe, Nov 26 2008
Extension by T. D. Noe, Nov 26 2008
Edited by Charles R Greathouse IV, Aug 02 2010
a(1) = 0 and a(46) and beyond from Michael S. Branicky, Jul 06 2022
Showing 1-5 of 5 results.