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”).

A261223
a(n) = number of steps to reach 0 when starting from k = (n*n)-1 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, 3, 5, 8, 11, 14, 18, 23, 28, 34, 40, 47, 54, 61, 69, 77, 86, 96, 106, 117, 128, 140, 152, 164, 177, 190, 204, 218, 233, 248, 264, 281, 298, 316, 334, 353, 372, 391, 411, 432, 453, 474, 496, 518, 541, 564, 588, 612, 637, 663, 689, 716, 743, 771, 799, 827, 856, 886, 916, 947, 978, 1009, 1041, 1073, 1106, 1139, 1173, 1207, 1242, 1277, 1313, 1350, 1387, 1425, 1463, 1502, 1541
OFFSET
1,3
LINKS
FORMULA
a(n) = A261221((n^2)-1).
a(n) = A261222(n)-1.
MATHEMATICA
Table[-2 + Length@ NestWhileList[# - Block[{m = #, c = 1}, While[a = (# - Floor[Sqrt@ #]^2) &@ m; a != 0, c++; m = a]; c] &, (n + 1)^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 (A261223 n) (if (= 1 n) 0 (+ (A261224 (- n 1)) (A261223 (- n 1)))))
(define (A261223 n) (A261221 (- (* n n) 1)))
CROSSREFS
One less than A261222.
Cf. also A260733, A261228.
Sequence in context: A005356 A060432 A156023 * A062009 A062484 A348450
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 12 2015
STATUS
approved