OFFSET
1,2
COMMENTS
The number 1 is the only term requiring just one term to determine if it is happy. Although the b-file appears to show that there are only a few numbers having 8 terms, see A193996 for more beginning at 78999.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=2, a(n)=9 because the iterations are 2, 4, 16, 37, 58, 89, 145, 42, 20, 4, 16,...
MATHEMATICA
f[n_] := Total[IntegerDigits[n]^2]; Table[Length[NestWhileList[f, n, UnsameQ, All]] - 1, {n, 100}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Aug 23 2011
STATUS
approved