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-5 of 5 results.

A316833 Sums of four distinct odd squares.

Original entry on oeis.org

84, 116, 140, 156, 164, 180, 196, 204, 212, 228, 236, 244, 252, 260, 276, 284, 300, 308, 316, 324, 332, 340, 348, 356, 364, 372, 380, 396, 404, 420, 428, 436, 444, 452, 460, 468, 476, 484, 492, 500, 508, 516, 524, 532, 540, 548, 556, 564, 572, 580, 588, 596, 604, 612, 620, 628, 636, 644, 652, 660
Offset: 1

Views

Author

N. J. A. Sloane, Jul 19 2018

Keywords

Comments

Theorem (Conjectured by R. William Gosper, proved by M. D. Hirschhorn): Any sum of four distinct odd squares is the sum of four distinct even squares.
The proof uses the following identity:
(4a+1)^2+(4b+1)^2+(4c+1)^2+(4d+1)^2 = 4[ (a+b+c+d+1)^2 + (a-b-c+d)^2 + (a-b+c-d)^2 + (a+b-c-d)^2 ].
All terms == 4 (mod 8). Are all numbers == 4 (mod 8) and > 412 members of the sequence? - Robert Israel, Jul 20 2018

References

  • R. William Gosper and Stephen K. Lucas, Postings to Math Fun Mailing List, July 19 2018
  • Michael D. Hirschhorn, The Power of q: A Personal Journey, Springer 2017. See Chapter 31.

Crossrefs

A316834 lists the subsequence for which the representation is unique.

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    V:= Vector(N):
    for a from 1 to floor(sqrt(N/4)) by 2 do
      for b from a+2 to floor(sqrt((N-a^2)/3)) by 2 do
        for c from b+2 to floor(sqrt((N-a^2-b^2)/2)) by 2 do
          for d from c + 2  by 2 do
            r:= a^2+b^2+c^2+d^2;
            if r > N then break fi;
            V[r]:= V[r]+1
    od od od od:
    select(t -> V[t]>=1, [$1..N]); # Robert Israel, Jul 20 2018

A316489 Positive numbers of the form 8*k + 4 that cannot be expressed as the sum of four distinct odd squares.

Original entry on oeis.org

4, 12, 20, 28, 36, 44, 52, 60, 68, 76, 92, 100, 108, 124, 132, 148, 172, 188, 220, 268, 292, 388, 412
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 27 2018

Keywords

Comments

There are no more terms through 10^11. It seems extremely unlikely that any more terms exist.
Every odd square is a number of the form 8*k + 1, so every sum of four odd squares is a number of the form 8*k + 4.
A316834 lists all numbers that can be expressed in only one way as the sum of four distinct odd squares.

Crossrefs

Cf. A316834.

A316490 Smallest positive number of the form 8*k + 4 that can be expressed as the sum of four distinct odd squares in exactly n ways, or 0 if no such number exists.

Original entry on oeis.org

4, 84, 156, 260, 380, 596, 420, 588, 732, 884, 660, 876, 900, 1164, 924, 1236, 1140, 1452, 1428, 1524, 1380, 1260, 1620, 2060, 1596, 1764, 1740, 2196, 2364, 2628, 1980, 3236, 2244, 2676, 2220, 2100, 2460, 3916, 2844, 2916, 2580, 2340, 2700, 4532, 3396, 4300
Offset: 0

Views

Author

Jon E. Schoenfield, Jul 28 2018

Keywords

Comments

Every odd square is a number of the form 8*k + 1, so every sum of four odd squares is a number of the form 8*k + 4.
A316489 lists all positive numbers of the form 8*k + 4 that cannot be expressed as the sum of four distinct odd squares.
A316834 lists all numbers that can be expressed in only one way as the sum of four distinct odd squares.
If a(571) > 0 then a(571) > 4*10^6. For 48 values of 0 <= n <= 9999 a(n) = 0 or at least 4*10^6. - David A. Corneth, Nov 28 2020

Examples

			The smallest positive number of the form 8*k + 4 is 4, which cannot be expressed as the sum of four distinct odd squares, so a(0) = 4.
The smallest number that can be expressed as the sum of four distinct odd squares is the sum of the first four odd squares, i.e., 1^2 + 3^2 + 5^2 + 7^2 = 84, which cannot be so expressed in any other way, so a(1) = 84.
a(6) = 420 because 420 is the smallest number that can be expressed as the sum of four distinct odd squares in exactly 6 ways:
  420 =  1^2 +  3^2 +  7^2 + 19^2
      =  1^2 +  3^2 + 11^2 + 17^2
      =  1^2 +  5^2 + 13^2 + 15^2
      =  1^2 +  7^2 +  9^2 + 17^2
      =  5^2 +  7^2 + 11^2 + 15^2
      =  7^2 +  9^2 + 11^2 + 13^2.
(Sums such as 3^2 + 5^2 + 5^2 + 19^2 are not counted because the four odd squares are not all distinct.)
		

Crossrefs

Cf. A316489 (0 ways), A316834 (1 way).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
          `if`(min(i, t)<1, 0, b(n, i-2, t)+
          `if`(i^2>n, 0, b(n-i^2, i-2, t-1))))
        end:
    a:= proc(n) option remember; local k;
          for k from 4 by 8 while n <> b(k, (r->
          r+1-irem(r, 2))(isqrt(k)), 4) do od; k
        end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Aug 07 2018
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[Min[i, t] < 1, 0, b[n, i - 2, t] + If[i^2 > n, 0, b[n - i^2, i - 2, t - 1]]]];
    a[n_] := a[n] = Module[{k}, For[k = 4, n != b[k, # + 1 - Mod[#, 2]& @ Floor @ Sqrt[k], 4], k += 8]; k];
    a /@ Range[0, 50] (* Jean-François Alcover, Nov 27 2020, after Alois P. Heinz *)

A316491 Number of ways to represent 8*n + 4 as the sum of four distinct odd squares.

Original entry on oeis.org

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

Views

Author

Jon E. Schoenfield, Jul 29 2018

Keywords

Comments

Every odd square is a number of the form 8*k + 1, so every sum of four odd squares is a number of the form 8*k + 4.
A316489 lists all positive numbers of the form 8*k + 4 that cannot be expressed as the sum of four distinct odd squares; for each such number, a(k)=0.
A316834 lists all numbers that can be expressed in only one way as the sum of four distinct odd squares; each such number is of the form 8*k + 4, and for each such number, a(k)=1.

Examples

			n=1: 8*1 + 4 = 12 cannot be expressed as the sum of four distinct odd squares, so a(1)=0.
n=10: 8*10 + 4 = 84 can be expressed as the sum of four distinct odd squares in only 1 way (84 = 1^2 + 3^2 + 5^2 + 7^2), so a(10)=1.
n=19: 8*19 + 4 = 156 can be expressed as the sum of four distinct odd squares in exactly 2 ways (156 = 1^2 + 3^2 + 5^2 + 11^2 = 1^2 + 5^2 + 7^2 + 9^2), so a(19)=2.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
          `if`(min(i, t)<1, 0, b(n, i-2, t)+
          `if`(i^2>n, 0, b(n-i^2, i-2, t-1))))
        end:
    a:= n-> (m-> b(m, (r-> r+1-irem(r, 2))(isqrt(m)), 4))(8*n+4):
    seq(a(n), n=0..100);  # Alois P. Heinz, Aug 05 2018
  • Mathematica
    a[n_] := Count[ IntegerPartitions[8 n + 4, {4}, Range[1, Sqrt[8 n + 4], 2]^2], w_ /; Max@Differences@w < 0]; Array[a, 87, 0] (* Giovanni Resta, Aug 12 2018 *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0],
         If[Min[i, t] < 1, 0, b[n, i-2, t] +
         If[i^2 > n, 0, b[n-i^2, i-2, t-1]]]];
    a[n_] := Function[m, b[m, Function[r, r+1-Mod[r, 2]][Floor@Sqrt[m]], 4]][8n+4];
    a /@ Range[0, 100] (* Jean-François Alcover, May 30 2021, after Alois P. Heinz *)

A316835 Sums of four distinct positive even squares.

Original entry on oeis.org

120, 156, 184, 200, 204, 216, 228, 248, 252, 260, 264, 280, 284, 296, 300, 312, 316, 324, 336, 340, 344, 348, 360, 364, 372, 376, 380, 392, 396, 408, 420, 424, 428, 436, 440, 444, 452, 456, 464, 468, 472, 476, 480, 484, 488, 492, 500, 504, 508, 516, 520, 524, 532, 536, 540, 548, 552
Offset: 1

Views

Author

N. J. A. Sloane, Jul 19 2018

Keywords

References

  • Michael D. Hirschhorn, The Power of q: A Personal Journey, Springer 2017. See Chapter 31.

Crossrefs

Equals 4*A004433. Cf. A316833, A316834.

Programs

  • Mathematica
    Total/@Subsets[(2*Range[10])^2,{4}]//Union (* Harvey P. Dale, May 21 2019 *)
Showing 1-5 of 5 results.