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!)
A356412 First differences of A007770 (happy numbers). 0
6, 3, 3, 6, 4, 5, 3, 1, 12, 5, 19, 2, 9, 3, 4, 5, 3, 3, 3, 3, 6, 20, 1, 3, 6, 28, 9, 12, 2, 2, 1, 10, 5, 11, 7, 4, 6, 3, 23, 1, 17, 11, 2, 8, 1, 8, 3, 6, 1, 6, 3, 2, 7, 18, 6, 3, 2, 1, 8, 3, 4, 3, 5, 1, 5, 7, 5, 31, 6, 18, 5, 9, 9, 3, 6, 40, 20, 7, 2, 1, 42, 9, 5, 1, 9, 3, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
El-Sedy and Siksek show that there exist arbitrarily long runs of consecutive integers that are happy numbers. So this sequence contains arbitrarily long runs of 1's.
LINKS
E. El-Sedy and S. Siksek, On happy numbers, Rocky Mountain J. Math. 30 (2000), 565-570.
FORMULA
a(n) = A007770(n+1) - A007770(n), where A007770(n) is the n-th happy number.
MATHEMATICA
happyQ[n_] := NestWhile[Plus @@ (IntegerDigits[#]^2) &, n, UnsameQ, All] == 1; Differences @ Select[Range[700], happyQ] (* Amiram Eldar, Aug 06 2022 *)
PROG
(Python)
from itertools import count, islice
def ssd(n): return sum(int(d)**2 for d in str(n))
def ok(n):
while n not in [1, 4]: n = ssd(n) # iterate until fixed point/cycle
return n==1
def agen(): # generator of terms
prevk = 1
for k in count(2):
if ok(k): yield k - prevk; prevk = k
print(list(islice(agen(), 88))) # Michael S. Branicky, Aug 06 2022
CROSSREFS
Cf. A007770.
Sequence in context: A327773 A085670 A011410 * A298206 A023407 A153841
KEYWORD
nonn,base
AUTHOR
Darío D. Devia, Aug 05 2022
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 June 27 16:54 EDT 2024. Contains 373746 sequences. (Running on oeis4.)