OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
E. S. Williams, Further Generalizations of Happy Numbers, Mathematical Association of America, (2016).
EXAMPLE
1134 is a term because the base-60 iteration of A007770 gives 1134 -> 3240 -> 2916 -> 3600 -> 1.
MAPLE
b:= proc() false end:
q:= proc(n) local m, s; m, s:= n, {};
do if m=1 then return true
elif m in s or b(m) then b(n):= true; return false
else s, m:= {s[], m}, add(i^2, i=convert(m, base, 60))
fi
od
end:
select(q, [$1..20000])[]; # Alois P. Heinz, Jan 05 2022
MATHEMATICA
Select[Range[15100], FixedPoint[Total[IntegerDigits[#, 60]^2] &, #, 60] == 1 &] (* Michael De Vlieger, Jan 04 2022 *)
PROG
(PARI) sumsod60(n) = my(d=digits(n, 60)); sum(i=1, #d, d[i]^2)
is(n) = my(v=[n]); while(1, v=concat(v, sumsod60(v[#v])); if(vecsort(v)!=vecsort(v, , 8) && n!=1, return(0)); if(vecmin(v)==1, return(1))) \\ Felix Fröhlich, Aug 22 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Cole Ditzler, Aug 21 2018
STATUS
approved