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.
%I A046017 #50 Jan 07 2024 19:05:29 %S A046017 2,9,8,7,28,18,18,46,54,82,98,108,20,91,107,133,80,172,80,90,90,90, %T A046017 234,252,140,306,305,90,305,396,170,388,170,387,378,388,414,468,449, %U A046017 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 %N A046017 Least k > 1 with k = sum of digits of k^n, or 0 if no such k exists. %C A046017 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 %D A046017 G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 208-210. %D A046017 Joe Roberts, "Lure of the Integers", The Mathematical Association of America, 1992, p. 172. %H A046017 Carole Dubois, <a href="/A046017/b046017.txt">Table of n, a(n) for n = 1..4522</a> (terms 1..1000 from T. D. Noe). %H A046017 Carole Dubois, <a href="/A046017/a046017.jpg">Scatterplot of A046017</a> %e A046017 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. %e A046017 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. %e A046017 a(13) = 20: 20^13=81920000000000000, 8+1+9+2=20. %e A046017 a(17) = 80: 80^17=225179981368524800000000000000000, 2+2+5+1+7+9+9+8+1+3+6+8+5+2+4+8 = 80. %t A046017 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 *) %t A046017 sdk[n_]:=Module[{k=2},While[k!=Total[IntegerDigits[k^n]],k++];k]; Array[sdk,70] (* _Harvey P. Dale_, Jan 07 2024 *) %o A046017 (Python) %o A046017 from itertools import chain %o A046017 def c(k, n): return sum(map(int, str(k**n))) == k %o A046017 def a(n): %o A046017 if n == 0: return False %o A046017 d, lim = 1, 1 %o A046017 while lim < n*9*d: d, lim = d+1, lim*10 %o A046017 m = next(k for k in chain(range(2, lim+1), (0,)) if c(k, n)) %o A046017 return m %o A046017 print([a(n) for n in range(1, 66)]) # _Michael S. Branicky_, Jul 06 2022 %Y A046017 Cf. A046459, A046000, A046471, A061211. %Y A046017 Cf. A133509 (n for which a(n)=0), A152147 (table of k for each n). %K A046017 base,nonn,nice %O A046017 1,1 %A A046017 _David W. Wilson_ %E A046017 More terms from _Asher Auel_, Jun 01 2000