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”).
%I #13 Mar 30 2017 21:57:33
%S 0,1,3,5,8,11,14,18,23,28,34,40,47,54,61,69,77,86,96,106,117,128,140,
%T 152,164,177,190,204,218,233,248,264,281,298,316,334,353,372,391,411,
%U 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
%N 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.
%H Antti Karttunen, <a href="/A261223/b261223.txt">Table of n, a(n) for n = 1..6000</a>
%F a(n) = A261221((n^2)-1).
%F a(n) = A261222(n)-1.
%t 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 *)
%o (Scheme, two variants, the other one using memoization-macro definec)
%o (definec (A261223 n) (if (= 1 n) 0 (+ (A261224 (- n 1)) (A261223 (- n 1)))))
%o (define (A261223 n) (A261221 (- (* n n) 1)))
%Y One less than A261222.
%Y Cf. A053610, A260740, A261221, A261224.
%Y Cf. also A260733, A261228.
%K nonn
%O 1,3
%A _Antti Karttunen_, Aug 12 2015