OFFSET
0,2
COMMENTS
Row lengths of the table A252648.
For a number with d digits, the sum of n-th powers cannot exceed d*9^n, but the number is not less than 10^(d-1). Therefore there is only a finite number of possible perfect digital invariants for any n, the largest of which has at most d* digits, where d* = 1+(n*log(9)+log d*)/log(10).
LINKS
Don Knuth, Table of n, a(n) for n = 0..172
Table of a(n) for n=0..172 [From Don Knuth, Sep 09 2015]
FORMULA
a(n) >= 2 for all n > 0, since 0 and 1 are digital invariants for any power n > 0.
EXAMPLE
a(0)=1 because 1 is the only number equal to the sum of 0th powers of its digits.
a(1)=10 because { 0, 1, ... 9 } are the only numbers equal to the sum of their digits (taken to the power 1).
a(2)=2 because 0 and 1 are the only numbers equal to the sum of the squares of their digits.
a(3)=6 because { 0, 1, 153, 370, 371, 407 } is the set of all numbers equal to the sum of the 3rd powers of their digits, cf. A046197.
For more examples, see the table A252648.
MATHEMATICA
Reap@ For[n = 0, n < 6, n++, Sow@ Length@ Select[Range[0, 10^(n + 1)], Plus @@ (IntegerDigits[#]^n) == # &]] // Flatten // Rest (* Michael De Vlieger, Apr 14 2015 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Apr 14 2015
EXTENSIONS
a(10)-a(90) from Don Knuth, Sep 09 2015
STATUS
approved