This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A261222 #13 Mar 30 2017 21:57:56 %S A261222 0,1,2,4,6,9,12,15,19,24,29,35,41,48,55,62,70,78,87,97,107,118,129, %T A261222 141,153,165,178,191,205,219,234,249,265,282,299,317,335,354,373,392, %U A261222 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 %N 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. %H A261222 Antti Karttunen, <a href="/A261222/b261222.txt">Table of n, a(n) for n = 0..6000</a> %F A261222 a(n) = A261221(n^2). %F A261222 Other identities. For all n >= 1: %F A261222 a(n) = 1 + A261223(n). %t A261222 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 *) %o A261222 (Scheme, two variants, the other one using memoization-macro definec) %o A261222 (definec (A261222 n) (if (<= n 1) n (+ (A261224 (- n 1)) (A261222 (- n 1))))) %o A261222 (define (A261222 n) (A261221 (* n n))) %Y A261222 Essentially one more than A261223. %Y A261222 First differences: A261224. %Y A261222 Cf. A000290, A053610, A260740, A261221. %Y A261222 Cf. also A260732, A261227. %K A261222 nonn %O A261222 0,3 %A A261222 _Antti Karttunen_, Aug 12 2015