A224981 Numbers that are the sum of exactly 6 distinct nonzero squares.
91, 104, 115, 119, 124, 130, 131, 136, 139, 143, 146, 147, 151, 152, 154, 155, 156, 159, 160, 163, 164, 166, 167, 168, 169, 170, 171, 175, 176, 178, 179, 180, 181, 182, 184, 187, 188, 190, 191, 192, 194, 195, 196, 199, 200, 201, 202, 203, 204, 206, 207, 208
Offset: 1
Keywords
Examples
a(1) = 1 + 4 + 9 + 16 + 25 + 36 = 91 = A000330(6); a(2) = 1 + 4 + 9 + 16 + 25 + 49 = 104; a(3) = 1 + 4 + 9 + 16 + 36 + 49 = 115; a(4) = 1 + 4 + 9 + 16 + 25 + 64 = 119; a(5) = 1 + 4 + 9 + 25 + 36 + 49 = 124.
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.
- Index entries for sequences related to sums of squares
Programs
-
Haskell
a224981 n = a224981_list !! (n-1) a224981_list = filter (p 6 $ 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)
-
Mathematica
nmax = 1000; S[n_] := S[n] = Union[Total /@ Subsets[ Range[Floor[Sqrt[n]]]^2, {6}]][[1 ;; nmax]]; S[nmax]; S[n = nmax + 1]; While[S[n] != S[n - 1], n++]; S[n] (* Jean-François Alcover, Nov 20 2021 *)