login
A193995
Maximum number of terms required to determine whether a number is happy or not (A007770 or A031177).
2
1, 9, 13, 8, 12, 17, 6, 13, 12, 2, 10, 13, 3, 14, 11, 8, 13, 11, 5, 8, 13, 14, 4, 9, 11, 10, 14, 4, 10, 13, 3, 4, 12, 12, 13, 16, 8, 10, 13, 9, 14, 8, 12, 5, 15, 12, 11, 14, 5, 12, 11, 11, 13, 15, 13, 10, 12, 8, 10, 17, 9, 10, 16, 12, 10, 15, 10, 3, 13, 6
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.
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
Sequence in context: A273614 A281224 A050236 * A070607 A340490 A335662
KEYWORD
nonn,base
AUTHOR
T. D. Noe, Aug 23 2011
STATUS
approved