OFFSET
1,3
COMMENTS
REFERENCES
Hugo Steinhaus: "Sto zadan" (1958), "One Hundred Problems in Elementary Mathematics" (1964), problem 2. [From M. F. Hasler, May 24 2009]
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
Arthur Porges, A set of eight numbers, Amer. Math. Monthly 52 (1945), 379-382. [M. F. Hasler, May 24 2009]
EXAMPLE
n=99999999999: iteration-list={99999999999,891,146,53,34,25,29,85,89,145,42,20,[4,16,37,58,89,145,42,20],4,...}. Lengths of transient=12, of cycle=8.
MATHEMATICA
fu[x_] :=Apply[Plus, IntegerDigits[x]^2]; hs=20; transient lengths are obtained by: a[n_] :=-1+Min[Flatten[Position[NestList[fu, n, Length[Union[NestList[fu, n, hs]]]] -Last[NestList[fu, n, Length[Union[NestList[fu, n, hs]]]]], 0]]], {n, 1, 256}];
PROG
(PARI) A099645(n)={ local( c=0, S=Set([1, 4, 16, 37, 58, 89, 145, 42, 20])); while( !setsearch(S, n), n=A003132(n); c++); c} \\ M. F. Hasler, May 24 2009
(Haskell)
a099645 = length . takeWhile (`notElem` a039943_list) . iterate a003132
a099645_list = map a099645 [1..]
-- Reinhard Zumkeller, Aug 24 2011
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Labos Elemer, Nov 08 2004
EXTENSIONS
Terms checked using the given PARI code. However, according to the domain of A003132 and the definition of A039943 (which both include 0), an initial a(0)=0 should be added here, too. - M. F. Hasler, May 24 2009
STATUS
approved