OFFSET
2,2
COMMENTS
If b>=2 and a >= 2*b^3, then S(a,3,b)<a. For each positive integer a, there is a positive integer m such that S^m(a,3,b)<2*b^3. (Grundman/Teeple, 2001, Lemma 8 and Corollary 9.)
LINKS
H. G. Grundman, E. A. Teeple, Generalized Happy Numbers, Fibonacci Quarterly 39 (2001), nr. 5, p. 462-466.
EXAMPLE
In the decimal system all integers go to (1); (153); (370); (371); (407) or (55, 250,133); (136, 244); (160, 217, 352); (919, 1459) under the iteration of sum of cubes of digits, hence there are five fixed points, two 2-cycles and two 3-cycles. Therefore a(10) = 5 + 2*2 + 2*3 = 15.
MAPLE
S:=proc(n, p, b) local Q, k, N, z; Q:=[convert(n, base, b)]; for k from 1 do N:=Q[k]; z:=convert(sum(N['i']^p, 'i'=1..nops(N)), base, b); if not member(z, Q) then Q:=[op(Q), z]; else Q:=[op(Q), z]; break; fi; od; return Q; end:
NumberOfAttractors:=proc(b) local A, i, Q; A:=[]: for i from 1 to 2*b^3 do Q:=S(i, 3, b); A:=[op(A), Q[nops(Q)]]; od: return(nops({op(A)})); end:
seq(NumberOfAttractors(b), b=2..20);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Martin Renner, Jul 31 2011
STATUS
approved