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.

Showing 1-8 of 8 results.

A003995 Sum of (any number of) distinct squares: of form r^2 + s^2 + t^2 + ... with 0 <= r < s < t < ...

Original entry on oeis.org

0, 1, 4, 5, 9, 10, 13, 14, 16, 17, 20, 21, 25, 26, 29, 30, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 97
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A001983, A033461, A008935. Complement of A001422.

Programs

  • Haskell
    a003995 n = a003995_list !! (n-1)
    a003995_list = filter (p a000290_list) [0..]
       where p (q:qs) m = m == 0 || q <= m && (p qs (m - q) || p qs m)
    -- Reinhard Zumkeller, Apr 22 2013
  • Mathematica
    lim = 10; s = {0}; Do[s = Union[s, s + n^2], {n, lim}]; Select[s, 0 <= # <= lim^2 &] (* T. D. Noe, Jul 10 2012 *)
  • PARI
    a(n)=if(n<1,0,n=a(n-1); until(polcoeff(prod(k=1,sqrt(n),1+x^k^2), n), n++); n)
    

Formula

Exponents in expansion of (1+x)*(1+x^4)*(1+x^9)*(1+x^16)*(1+x^25)*(1+x^36)*(1+x^49)*(1+x^64)*(1+x^81)*(1+x^100)*(1+x^121)*(1+x^144)*...
For n > 98, a(n) = n + 30. - Charles R Greathouse IV, Sep 02 2011 (This implies a(n+2) = 2*a(n+1)-a(n) for n > 98.)

A004432 Numbers that are the sum of 3 distinct nonzero squares.

Original entry on oeis.org

14, 21, 26, 29, 30, 35, 38, 41, 42, 45, 46, 49, 50, 53, 54, 56, 59, 61, 62, 65, 66, 69, 70, 74, 75, 77, 78, 81, 83, 84, 86, 89, 90, 91, 93, 94, 98, 101, 104, 105, 106, 107, 109, 110, 113, 114, 115, 116, 117, 118, 120, 121, 122, 125, 126, 129, 131, 133
Offset: 1

Views

Author

Keywords

Comments

Numbers that can be written as a(n) = x^2 + y^2 + z^2 with 0 < x < y < z.
This is a subsequence (equal to the range) of A024803. As a set, it is the union of A025339 and A024804, subsequences of numbers having exactly one, resp. more than one, such representations. - M. F. Hasler, Jan 25 2013
Conjecture: a number n is a sum of 3 squares, but not a sum of 3 distinct nonzero squares (i.e., is in A004432 but not A000408), if and only if it is of the form 4^j*s, where j >= 0 and s in {1, 2, 3, 5, 6, 9, 10, 11, 13, 17, 18, 19, 22, 25, 27, 33, 34, 37, 43, 51, 57, 58, 67, 73, 82, 85, 97, 99, 102, 123, 130, 163, 177, 187, 193, 267, 627, 697}. - Jeffrey Shallit, Jan 15 2017
4*a(n) gives the sums of 3 distinct nonzero even squares. - Wesley Ivan Hurt, Apr 05 2021

Examples

			14 = 1^2 + 2^2 + 3^2;
62 = 1^2 + 5^2 + 6^2.
		

Crossrefs

Programs

  • Haskell
    a004432 n = a004432_list !! (n-1)
    a004432_list = filter (p 3 $ 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)
    -- Reinhard Zumkeller, Apr 22 2013
  • Mathematica
    f[upto_]:=Module[{max=Floor[Sqrt[upto]]},Select[Union[Total/@ (Subsets[ Range[ max],{3}]^2)],#<=upto&]]; f[150]  (* Harvey P. Dale, Mar 24 2011 *)
  • PARI
    is_A004432(n)=for(x=1,sqrtint(n\3),for(y=x+1,sqrtint((n-1-x^2)\2),issquare(n-x^2-y^2)&return(1)))  \\ M. F. Hasler, Feb 02 2013
    

Formula

A004432 = { x^2 + y^2 + z^2; 0 < x < y < z }.
n is in A004432 <=> A025442(n) > 0. - M. F. Hasler, Feb 03 2013

A004433 Numbers that are the sum of 4 distinct nonzero squares: of form w^2+x^2+y^2+z^2 with 0

Original entry on oeis.org

30, 39, 46, 50, 51, 54, 57, 62, 63, 65, 66, 70, 71, 74, 75, 78, 79, 81, 84, 85, 86, 87, 90, 91, 93, 94, 95, 98, 99, 102, 105, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 129, 130, 131, 133, 134, 135, 137
Offset: 1

Views

Author

Keywords

Examples

			30 = 1^2+2^2+3^2+4^2.
		

Crossrefs

Programs

  • Haskell
    a004433 n = a004433_list !! (n-1)
    a004433_list = filter (p 4 $ 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)
    -- Reinhard Zumkeller, Apr 22 2013
    
  • Mathematica
    data = Flatten[ DeleteCases[ FindInstance[ w^2 + x^2 + y^2 + z^2 == # && 0 < w < x < y < z < #, {w, x, y, z}, Integers] & /@ Range[137], {}], 1]; w^2 + x^2 + y^2 + z^2 /. data (* Ant King, Oct 17 2010 *)
    Select[Union[Total[#^2]&/@Subsets[Range[10],{4}]],#<=137&] (* Harvey P. Dale, Jul 03 2011 *)
  • PARI
    list(lim)=my(v=List([30, 39, 46, 50, 51, 54, 57, 62, 63, 65, 66, 70, 71, 74, 75, 78, 79, 81, 84, 85, 86, 87, 90, 91, 93, 94, 95, 98, 99, 102, 105, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 129, 130, 131, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 145, 146, 147, 149, 150, 151, 153, 154, 155, 156]), u=[160, 168, 172, 176, 188, 192, 208, 220, 224, 232, 240, 256, 268, 272, 288, 292, 304, 320, 328, 352, 368, 384, 388, 400, 412, 416, 432, 448, 496, 512, 528, 544, 576, 592, 608], t=1); if(lim<156, return(select(k->k<=lim, Vec(v)))); for(n=158,lim\1, if(n#u, t=1)); Vec(v) \\ Charles R Greathouse IV, Jan 08 2025

Formula

{n: A025443(n) >=1}. Union of A025386 and A025376. - R. J. Mathar, Jun 15 2018
a(n) = n + O(log n). - Charles R Greathouse IV, Jan 08 2025

A224981 Numbers that are the sum of exactly 6 distinct nonzero squares.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Apr 22 2013

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.
		

Crossrefs

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 *)

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 *)

A224983 Numbers that are the sum of exactly 8 distinct nonzero squares.

Original entry on oeis.org

204, 221, 236, 240, 249, 255, 260, 261, 268, 269, 272, 276, 279, 281, 284, 285, 288, 289, 293, 295, 296, 299, 300, 303, 305, 306, 309, 311, 312, 316, 317, 320, 321, 323, 324, 325, 326, 327, 329, 332, 333, 335, 336, 337, 338, 339, 340, 341, 344, 345, 347, 348
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 22 2013

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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)
  • 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 *)

A033985 Number of partitions of n into two or more distinct nonzero squares.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 0, 0, 2, 2, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 1, 0, 0, 2, 2, 0, 0, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 0, 2, 3, 1, 0, 4, 3, 0, 1, 2, 2, 1, 0, 1, 4, 3, 0, 2, 4, 2, 1, 2, 2, 1, 2, 3, 3, 2, 1, 3, 6, 3, 0, 2, 5, 3, 0, 1, 3, 3, 2
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

G.f.: Product_{k>=1} (1+x^(k^2)) - Sum_{k>=1} x^(k^2). - Sean A. Irvine, Jul 26 2020

Extensions

Title improved by Sean A. Irvine, Jul 26 2020

A193142 Primes which are the sum of 5 distinct positive squares.

Original entry on oeis.org

79, 103, 127, 131, 139, 151, 157, 163, 167, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433
Offset: 1

Views

Author

Keywords

Comments

A004434 INTERSECTION A000040. [Charles R Greathouse IV, Jul 17 2011]

Examples

			79=1^2+2^2+3^2+4^2+7^2, 103=2^2+3^2+4^2+5^2+7^2, 127=1^2+2^2+3^2+7^2+8^2.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[Do[Do[Do[Do[p = a^2 + b^2 + c^2 + d^2 + e^2; If[PrimeQ[p], AppendTo[lst, p]], {e, d - 1, 1, -1}], {d, c - 1, 1, -1}], {c, b - 1, 1, -1}], {b, a - 1, 1, -1}], {a, 6, 20}]; OEISTrim[Take[Union[lst], 80]]
    With[{upto=500},Select[Union[Total/@Subsets[Range[Ceiling[Sqrt[upto-30]]]^2, {5}]],PrimeQ[#]&&#<=upto&]] (* Harvey P. Dale, Jun 05 2016 *)
  • PARI
    upto(lim)=my(v=List(),tb,tc,td,te);for(a=6,sqrt(lim),for(b=4,min(a-1,sqrt(lim-a^2)),tb=a^2+b^2;for(c=3,min(b-1,sqrt(lim-tb)),tc=tb+c^2;for(d=2,min(c-1,sqrt(lim-tc)),td=tc+d^2;forstep(e=1+td%2,d-1,2,te=td+e^2;if(te>lim,break);if(isprime(te),listput(v,te)))))));vecsort(Vec(v),,8) \\ Charles R Greathouse IV, Jul 17 2011

Formula

Conjecture: a(n) = prime(n+32) for n > 13. [Charles R Greathouse IV, Jul 17 2011]
Showing 1-8 of 8 results.