OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..500
EXAMPLE
a(3) = 18 because the 18 different sums of 5 squares of integers from 0 to 2 are: {20, 17, 16, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} by permutations of 2^2 + 2^2 + 2^2 + 2^2 + 2^2 = 20; 2^2 + 2^2 + 2^2 + 2^2 + 1^2 = 17; 2^2 + 2^2 + 2^2 + 2^2 + 0^2 = 16; 2^2 + 2^2 + 2^2 + 1^2 + 1^2 = 14; 2^2 + 2^2 + 2^2 + 1^2 + 0^2 = 13; 2^2 + 2^2 + 2^2 + 0^2 + 0^2 = 12; 2^2 + 2^2 + 1^2 + 1^2 + 1^2 = 11; 2^2 + 2^2 + 1^2 + 1^2 + 0^2 = 10; 2^2 + 2^2 + 1^2 + 0^2 + 0^2 = 9; 2^2 + 2^2 + 0^2 + 0^2 + 0^2 = 2^2 + 1^2 + 1^2 + 1^2 + 1^2 = 8; 2^2 + 1^2 + 1^2 + 1^2 + 0^2 = 7; 2^2 + 1^2 + 1^2 + 0^2 + 0^2 = 6; 2^2 + 1^2 + 0^2 + 0^2 + 0^2 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 = 5; 2^2 + 0^2 + 0^2 + 0^2 + 0^2 = 1^2 + 1^2 + 1^2 + 1^2 + 0^2 = 4; 1^2 + 1^2 + 1^2 + 0^2 + 0^2 = 3; 1^2 + 1^2 + 0^2 + 0^2 + 0^2 = 2; 1^2 + 0^2 + 0^2 + 0^2 + 0^2 = 1; 0^2 + 0^2 + 0^2 + 0^2 + 0^2 = 0.
MAPLE
S:= proc(k, n) option remember;
if k = 0 or n = 0 then {0} else
`union`(seq(map(`+`, procname(j, n-1), (k-j)*n^2), j=1..k-1),
{k*n^2}, procname(k, n-1)) fi end proc:
seq(nops(S(5, n)), n=0..100); # Robert Israel, Jun 28 2018
MATHEMATICA
Table[Length@ Union@Flatten@ Table[i^2 + j^2 + k^2 + l^2 + m^2, {i, 0, n}, {j, i, n}, {k, j, n}, {l, k, n}, {m, l, n}], {n, 0, 49}]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Nov 13 2007, Nov 14 2007
EXTENSIONS
Offset corrected by Giovanni Resta, Jun 18 2016
STATUS
approved