|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|