OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
2*R_11 = 2*11111111111 = 22222222222 is a happy number, so 11 is in the list.
PROG
(Python)
from itertools import count, islice
def A098731_gen(startvalue=1): # generator of terms
for n in count(max(startvalue, 1)):
m = n<<2
while m not in {1, 37, 58, 89, 145, 42, 20, 4, 16}:
m = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(m))
if m == 1:
yield n
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Lambert Klasen (lambert.klasen(AT)gmx.de), Oct 28 2004
STATUS
approved