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