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!)
A364682 Number of iterations of the "x -> sum of squares of digits of x" map (A003132) for n to converge to either 0, 1 or the 8-cycle (37,58,89,145,42,20,4,16). 1
1, 1, 2, 6, 1, 5, 10, 6, 6, 5, 2, 3, 6, 3, 7, 4, 1, 6, 4, 5, 1, 6, 7, 4, 2, 4, 3, 7, 4, 3, 6, 3, 4, 5, 5, 6, 9, 1, 3, 6, 2, 7, 1, 5, 5, 8, 5, 4, 7, 5, 5, 4, 4, 6, 8, 6, 3, 5, 1, 3, 10, 2, 3, 9, 5, 3, 8, 3, 3, 6, 6, 6, 7, 2, 4, 5, 3, 3, 5, 4, 6, 4, 4, 3, 7, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
The initial number counts as iteration 1.
LINKS
FORMULA
a(n) <= A193995(n) with equality if and only if n is a Happy number (A007770).
a(n) = 1 if and only if n is in A039943.
a(n) = A099645(n)+1.
PROG
(Python)
def A364682(n):
c = 1
while n not in {0, 1, 37, 58, 89, 145, 42, 20, 4, 16}:
n = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(n))
c += 1
return c
CROSSREFS
Sequence in context: A243434 A265416 A199953 * A076039 A280580 A288872
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Aug 02 2023
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 August 19 08:45 EDT 2024. Contains 375284 sequences. (Running on oeis4.)