cp's OEIS Frontend

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.

A224982 Numbers that are the sum of exactly 7 distinct nonzero squares.

Original entry on oeis.org

140, 155, 168, 172, 179, 185, 188, 191, 195, 196, 200, 203, 204, 205, 211, 212, 215, 217, 219, 220, 224, 225, 227, 230, 231, 232, 233, 235, 236, 239, 240, 243, 244, 245, 246, 247, 248, 251, 252, 254, 256, 257, 259, 260, 263, 264, 265, 267, 268, 269, 270, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 22 2013

Keywords

Examples

			a(1) = 1 + 4 + 9 + 16 + 25 + 36 + 49 = 140 = A000330(7);
a(2) = 1 + 4 + 9 + 16 + 25 + 36 + 64 = 155;
a(3) = 1 + 4 + 9 + 16 + 25 + 49 + 64 = 168;
a(4) = 1 + 4 + 9 + 16 + 25 + 36 + 81 = 172;
a(5) = 1 + 4 + 9 + 16 + 36 + 49 + 64 = 179.
		

Crossrefs

Programs

  • Haskell
    a224982 n = a224982_list !! (n-1)
    a224982_list = filter (p 7 $ 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, {7}]][[1 ;; nmax]];
    S[nmax];
    S[n = nmax + 1];
    While[S[n] != S[n - 1], n++];
    S[n] (* Jean-François Alcover, Nov 20 2021 *)