OFFSET
1,2
COMMENTS
Numbers for which the repeated application of the operation "Sum the squares of the digits of the base-5 representation" is trapped by (ends at) the fixed point 1.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
H. G. Grundmann, Semihappy Numbers, J. Int. Seq. 13 (2010), 10.4.8.
EXAMPLE
19 is a quinary happy number because 19=34_5 -> 3^2 + 4^2 = 25 = 100_5 -> 1+0+0 = 1.
MAPLE
isA240849 := proc(n)
t := SqrdB5(n) ;
tloo := {} ;
for i from 1 do
if t = 1 then
return true;
end if;
if t in tloo then
return false;
end if;
tloo := tloo union {t} ;
t := A276191(t) ;
end do:
end proc:
for n from 1 to 300 do
if isA240849(n) then
printf("%d, ", n) ;
end if;
end do: # R. J. Mathar, Aug 24 2016
MATHEMATICA
happyQ[n_, b_] := NestWhile[Plus @@ (IntegerDigits[#, b]^2) &, n, UnsameQ, All] == 1; Select[Range[250], happyQ[#, 5] &] (* Amiram Eldar, May 28 2020 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jiri Klepl, Apr 13 2014
STATUS
approved