OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Paul T. Bateman, Adolf J. Hildebrand, and George B. Purdy, Sums of distinct squares, Acta Arithmetica 67 (1994), pp. 349-380.
EXAMPLE
a(1) = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 64 = 204 = A000330(8);
a(2) = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 81 = 221;
a(3) = 1 + 4 + 9 + 16 + 25 + 36 + 64 + 81 = 236;
a(4) = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 100 = 240;
a(5) = 1 + 4 + 9 + 16 + 25 + 49 + 64 + 81 = 249.
MATHEMATICA
nmax = 1000;
S[n_] := S[n] = Union[Total /@ Subsets[
Range[Floor[Sqrt[n]]]^2, {8}]][[1 ;; nmax]];
S[nmax];
S[n = nmax + 1];
While[S[n] != S[n - 1], n++];
S[n] (* Jean-François Alcover, Nov 20 2021 *)
PROG
(Haskell)
a224983 n = a224983_list !! (n-1)
a224983_list = filter (p 8 $ tail a000290_list) [1..] where
p k (q:qs) m = k == 0 && m == 0 ||
q <= m && k >= 0 && (p (k - 1) qs (m - q) || p k qs m)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Apr 22 2013
STATUS
approved