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.
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
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..6000
Programs
-
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 *)