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 A215574 #24 Nov 22 2020 12:22:40 %S A215574 1,10,21,84,55,156,140,240,342,470,506,864,819,1176,1395,1616,1785, %T A215574 2214,2470,3260,3570,4092,4324,5184,5525,6578,7101,8456,8555,9750, %U A215574 10416,11712,13134,14314,14910,16776,17575,19570,21099,22760,23821,26166,27434,30096 %N A215574 Minimal sum s of n distinct squares such that s is divisible by n. %C A215574 At n = 6k +/- 1, there is a simple formula a(n) = n*(n+1)*(2n+1)/6 and set of squares is the first n squares {1..n}^2. %C A215574 Companion sequence of minimal integral averages of n distinct squares is a(n)/n: 1, 5, 7, 21, 11, 26, 20, 30, 38, 47, 46, 72, 63, 84, 93, 101, 105, 123, 130, 163, 170, 186, 188, 216, 221, ... . %H A215574 Alois P. Heinz, <a href="/A215574/b215574.txt">Table of n, a(n) for n = 1..301</a> %H A215574 Zak Seidov, <a href="/A215574/a215574.txt">Minimal sums and their n distinct summand squares for n = 1..25</a> %e A215574 a(1) = 1 = 1^2 = 1*1. %e A215574 a(2) = 10 = 1^2 + 3^2 = 2*5. %e A215574 a(3) = 21 = 1^2 + 2^2 + 4^2 = 3*7. %e A215574 a(4) = 84 = 1^2 + 3^2 + 5^2 + 7^2 = 4*21. %e A215574 a(5) = 55 = 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 5*11. %p A215574 b:= proc(n, i, t) option remember; local h; h:= t*(t+1)*(2*t+1)/6; %p A215574 i>=t and n>=h and (n=h or t>0 and %p A215574 (b(n, i-1, t) or i<=n and b(n-i^2, i-1, t-1))) %p A215574 end: %p A215574 a:= proc(n) local s; %p A215574 for s from n*ceil((n+1)*(2*n+1)/6) by n %p A215574 while not b(s, iroot(s, 2)+1, n) %p A215574 do od; s %p A215574 end: %p A215574 seq(a(n), n=1..50); # _Alois P. Heinz_, Aug 16 2012 %t A215574 $RecursionLimit = 2000; %t A215574 b[n_, i_, t_] := b[n, i, t] = Module[{h = t(t+1)(2t+1)/6}, i >= t && n >= h && (n==h || t>0 && (b[n, i-1, t] || i <= n && b[n-i^2, i-1, t-1]))]; %t A215574 a[n_] := Module[{s}, For[s = n Ceiling[(n+1)(2n+1)/6], !b[s, Floor @ Sqrt[s] + 1, n], s += n]; s]; %t A215574 Array[a, 50] (* _Jean-François Alcover_, Nov 22 2020, after _Alois P. Heinz_ *) %Y A215574 Cf. A000330, A164576. %K A215574 nonn %O A215574 1,2 %A A215574 _Zak Seidov_, Aug 16 2012 %E A215574 More terms from _Alois P. Heinz_, Aug 16 2012