login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A261222
a(n) = number of steps to reach 0 when starting from k = n*n and repeatedly applying the map that replaces k with k - A053610(k), where A053610(k) = the number of positive squares that sum to k using the greedy algorithm.
9
0, 1, 2, 4, 6, 9, 12, 15, 19, 24, 29, 35, 41, 48, 55, 62, 70, 78, 87, 97, 107, 118, 129, 141, 153, 165, 178, 191, 205, 219, 234, 249, 265, 282, 299, 317, 335, 354, 373, 392, 412, 433, 454, 475, 497, 519, 542, 565, 589, 613, 638, 664, 690, 717, 744, 772, 800, 828, 857, 887, 917, 948, 979, 1010, 1042, 1074, 1107, 1140, 1174, 1208, 1243, 1278, 1314, 1351, 1388, 1426, 1464, 1503
OFFSET
0,3
LINKS
FORMULA
a(n) = A261221(n^2).
Other identities. For all n >= 1:
a(n) = 1 + A261223(n).
MATHEMATICA
Table[-1 + Length@ NestWhileList[# - Block[{m = #, c = 1}, While[a = (# - Floor[Sqrt@ #]^2) &@ m; a != 0, c++; m = a]; c] &, n^2, # != 0 &], {n, 0, 77}] (* Michael De Vlieger, Sep 08 2016, after Jud McCranie at A053610 *)
PROG
(Scheme, two variants, the other one using memoization-macro definec)
(definec (A261222 n) (if (<= n 1) n (+ (A261224 (- n 1)) (A261222 (- n 1)))))
(define (A261222 n) (A261221 (* n n)))
CROSSREFS
Essentially one more than A261223.
First differences: A261224.
Cf. also A260732, A261227.
Sequence in context: A194229 A194201 A194203 * A130025 A278299 A145802
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 12 2015
STATUS
approved