The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A099646 Function f(n) = 1 + Sum(digit^2 of n) is iterated and a(n) is the length of terminal cycle at initial value n. 5
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 9, 9, 9, 9, 9, 9, 1, 9, 9, 9, 1, 9, 9, 9, 9, 9, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Iteration g(x) applied in A031176 is slightly modified to obtain actual function: f(x) = 1 + g(x). Cases of a(n) = 1 (n = 35, 36, 46, 53, 57, 63, 64, 75, 135, ...) are analogous to happy numbers A007770.
LINKS
EXAMPLE
For n = 1: iteration-list=
{1,2,5,26,41,18,66,73,59,107,51,[27,54,42,21,6,37,59,107,51],27...
with t = 11 transient and c = a(1) = 9, the cycle-length;
For n = 35: list={36,46,53,[35],35,...} with transient t = 3, c = 1 cycle-length.
MATHEMATICA
ed[x_] :=IntegerDigits[x]; f[x_] :=Apply[Plus, ed[x]^2]+1; itef[x_, ho_] :=NestList[f, x, ho]; tmc=Table[Length[Union[itef[w, 100], {w, 1, 256}]; c1=Table[Min[Flatten[Position[itef[w, Length[Union[itef[w, 100]]]] -Last[itef[w, Length[Union[itef[w, 100]]]]], 0]]], {w, 1, 256}]; (* transient-length= *) c1-1; (* cycle-length= *) c=tmc-(c1-1); (* ho=iteration number is chosen by trial and error *) (* program provides t, t+c and c lengths[=unknown-in-advance] for any similar iterations if f modified *)
(* Second program: *)
With[{nn = 10^3}, Table[Function[s, Length@ KeySelect[s, Length@ Lookup[s, #] > 1 &]]@ PositionIndex@ NestList[1 + Total[ IntegerDigits[#]^2] &, n, nn], {n, 105}]] (* Michael De Vlieger, Jul 24 2017 *)
CROSSREFS
Sequence in context: A292864 A363120 A363021 * A181693 A271880 A180599
KEYWORD
nonn,base
AUTHOR
Labos Elemer, Nov 11 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 29 05:22 EDT 2024. Contains 372921 sequences. (Running on oeis4.)