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

A278081 a(n) is 1/12 of the number of primitive quadruples with sum = 0 and sum of squares = 2*m^2, where m = 2*n - 1.

Original entry on oeis.org

1, 2, 6, 8, 6, 10, 14, 12, 16, 18, 16, 24, 30, 18, 30, 32, 20, 48, 38, 28, 40, 42, 36, 48, 56, 32, 54, 60, 36, 58, 62, 48, 84, 66, 48, 72, 72, 60, 80, 80, 54, 82, 96, 60, 88, 112, 64, 108, 96, 60, 102, 104, 96, 106, 110, 76, 112, 144, 84, 128, 110, 80, 150, 128
Offset: 1

Views

Author

Colin Mallows, Nov 14 2016

Keywords

Comments

Set b(m) = a(n) for m = 2*n-1, and b(m) = 0 for m even.
Conjecture: b(m) is multiplicative: for k >= 1, b(2^k) = 0; for p an odd prime, b(p*k) = p^(k-1)*b(p); b(p)= p + 1 for p == (5, 7, 13, 23) (mod 24); b(p) = p-1 for p == (1, 11, 17, 19) (mod 24); and b(3) = 3. It would be nice to have a proof of this.
This sequence applies also to the case sum = 4*m and ssq = 6*m^2. Generally, there is a 1-to-1 correspondence between a quadruple (h,i,j,k) with sum = r*m and ssq = s*m^2 and another with r'*m and s'*m^2, resp., if r + r'= 4, s - r = s' - r', namely (h',i',j',k') = (m,m,m,m) - (h,i,j,k). [Edited by Petros Hadjicostas, Apr 21 2020]

Examples

			For the case r = 0 and s = 2, we have a(2) = 2 = b(3) because of (-3,-1,2,2) and (-2,-2,1,3) (12 permutations each). For example, (-3) + (-1) + 2 + 2 = 0 but (-3)^2 + (-1)^2 + 2^2 + 2^2 = 18 = 2*3^2 = 2*(2*2-1)^2 (with n = 2 and m = 3).
For the case r = 4 and s = 6, we again have a(2) = 2 = b(3) because of (3,3,3,3) - (-3,-1,2,2) = (6,4,1,1) and (3,3,3,3) - (-2,-2,1,3) = (5,5,2,0) (12 permutations each). For example, 5 + 5 + 2 + 0 = 12 = 4*3 and 5^2 + 5^2 + 2^2 + 0^2 = 54 = 6*3^2 (with n = 2 and m = 3).
		

Crossrefs

Programs

  • Mathematica
    sqrtint = Floor[Sqrt[#]]&;
    q[r_, s_, g_] := Module[{d = 2s - r^2, h}, If[d <= 0, d==0 && Mod[r, 2]==0 && GCD[g, r/2]==1, h = Sqrt[d]; If[IntegerQ[h] && Mod[r+h, 2]==0 && GCD[g, GCD[(r+h)/2, (r-h)/2]]==1, 2, 0]]] /. {True -> 1, False -> 0};
    a[n_] := Module[{m = 2n - 1, s}, s = 2m^2; Sum[q[i + j, s - i^2 - j^2, GCD[i, j]], {i, -sqrtint[s], sqrtint[s]}, {j, -sqrtint[s - i^2], sqrtint[s - i^2]}]/12];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* Jean-François Alcover, Sep 20 2020, after Andrew Howroyd *)
  • PARI
    q(r, s, g)={my(d=2*s - r^2); if(d<=0, d==0 && r%2==0 && gcd(g, r/2)==1, my(h); if(issquare(d, &h) && (r+h)%2==0 && gcd(g, gcd((r+h)/2, (r-h)/2))==1, 2, 0))}
    a(n)={my(m=2*n-1, s=2*m^2); sum(i=-sqrtint(s), sqrtint(s), sum(j=-sqrtint(s-i^2), sqrtint(s-i^2), q(i+j, s-i^2-j^2, gcd(i,j)) ))/12} \\ Andrew Howroyd, Aug 02 2018

Extensions

Terms a(51) and beyond from Andrew Howroyd, Aug 02 2018
Name and example section edited by Petros Hadjicostas, Apr 21 2020

A278086 1/12 of the number of integer quadruples with sum = 3*n and sum of squares = 7*n^2.

Original entry on oeis.org

1, 1, 4, 0, 4, 4, 6, 0, 12, 4, 10, 0, 14, 6, 16, 0, 16, 12, 19, 0, 24, 10, 22, 0, 20, 14, 36, 0, 30, 16, 32, 0, 40, 16, 24, 0, 38, 19, 56, 0, 42, 24, 42, 0, 48, 22, 46, 0, 42, 20, 64, 0, 54, 36, 40, 0, 76, 30, 60, 0, 60, 32, 72, 0, 56, 40, 68, 0, 88, 24, 72, 0, 72, 38, 80, 0, 60, 56, 80, 0, 108, 42, 82, 0, 64, 42, 120, 0, 90, 48, 84, 0, 128, 46, 76, 0, 98, 42, 120, 0
Offset: 1

Views

Author

Colin Mallows, Nov 14 2016

Keywords

Comments

Conjecture: a(n) is multiplicative with a(2) = 1, a(2^k) = 0 for k >= 2, and for k >= 1 and p an odd prime, a(p^k) = p^(k-1)*a(p) with a(p) = p + 1 for p == (2, 3, 8, 10, 12, 13, 14, 15, 18) (mod 19), a(p) = p - 1 for p == (1, 4, 5, 6, 7, 9, 11, 16, 17) (mod 19), and p(19) = 19. It would be nice to have a proof of this.
This sequence applies also to the case sum = n and ssq = 5*n^2.

Examples

			For the case r = 3 and s = 7, we have 12*a(3) = 48 because of (-3,2,5,5) and (-1,-1,5,6) (12 permutations each) and (-2,1,3,7) (24 permutations). For example, (-3) + 2 + 5 + 5 = 9 = 3*3 and (-3)^2 + 2^2 + 5^2 + 5^2 = 63 = 7*3^2.
For the case r = 1 and s = 5, we again have 12*a(3) = 48 because of (3,3,3,3) - (-3,2,5,5) = (6,1,-2,-2) and (3,3,3,3) - (-1,-1,5,6) = (4,4,-2,-3) (12 permutations each) and (3,3,3,3) - (-2,1,3,7) = (5,2,0,-4) (24 permutations). For example, 5 + 2 + 0 + (-4) = 3 = 1*3 and 5^2 + 2^2 + 0^2 + (-4)^2 = 45 = 5*3^2.
		

Crossrefs

Programs

  • Mathematica
    sqrtint = Floor[Sqrt[#]]&;
    q[r_, s_, g_] := Module[{d = 2 s - r^2, h}, If[d <= 0, d == 0 && Mod[r, 2] == 0 && GCD[g, r/2] == 1, h = Sqrt[d]; If[IntegerQ[h] && Mod[r+h, 2] == 0 && GCD[g, GCD[(r+h)/2, (r-h)/2]]==1, 2, 0]]] /. {True -> 1, False -> 0};
    a[n_] := Module[{s}, s = 7 n^2; Sum[q[3 n - i - j, s - i^2 - j^2, GCD[i, j]], {i, -sqrtint[s], sqrtint[s]}, {j, -sqrtint[s - i^2], sqrtint[s - i^2]}]/12];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* Jean-François Alcover, Sep 20 2020, after Andrew Howroyd *)
  • PARI
    q(r, s, g)={my(d=2*s - r^2); if(d<=0, d==0 && r%2==0 && gcd(g, r/2)==1, my(h); if(issquare(d, &h) && (r+h)%2==0 && gcd(g, gcd((r+h)/2, (r-h)/2))==1, 2, 0))}
    a(n)={my(s=7*n^2); sum(i=-sqrtint(s), sqrtint(s), sum(j=-sqrtint(s-i^2), sqrtint(s-i^2), q(3*n-i-j, s-i^2-j^2, gcd(i,j)) ))/12} \\ Andrew Howroyd, Aug 02 2018

Extensions

Example section edited by Petros Hadjicostas, Apr 21 2020

A278082 1/12 of the number of primitive quadruples with sum = n and sum of squares = 3*n^2.

Original entry on oeis.org

1, 1, 2, 0, 4, 2, 8, 0, 6, 4, 11, 0, 14, 8, 8, 0, 18, 6, 20, 0, 16, 11, 22, 0, 20, 14, 18, 0, 30, 8, 30, 0, 22, 18, 32, 0, 36, 20, 28, 0, 42, 16, 44, 0, 24, 22, 46, 0, 56, 20, 36, 0, 52, 18, 44, 0, 40, 30, 58, 0, 62, 30, 48, 0, 56, 22, 66, 0, 44, 32, 70, 0, 74, 36, 40, 0, 88, 28, 80, 0, 54, 42, 84, 0, 72, 44, 60, 0, 88, 24, 112, 0, 60, 46, 80, 0, 96, 56, 66, 0
Offset: 1

Views

Author

Colin Mallows, Nov 14 2016

Keywords

Comments

Conjecture: a(n) is multiplicative, with a(2) = 1, a(2^k) = 0 (k >= 2); a(p^k) = p^(k-1)*a(p); a(p) = p + 1 for p == (2, 6, 7, 8, 10)(mod 11), a(p) = p - 1 for p == (1, 3, 4, 5, 9)(mod 11); and p(11) = 11. It would be nice to have a proof of this.
This sequence applies also to the case sum = 3*n and ssq = 5*n^2. - Colin Mallows, Nov 30 2016 [Edited by Petros Hadjicostas, Apr 20 2020]

Examples

			For the case r = 1 and r = 3, we have 12*a(3) = 24 because of (-3,1,1,4) and (-1,-1,0,5) (12 permutations each). For example, (-3) + 1 + 1 + 4 = 3 = 1*3 and (-3)^2 + 1^2 + 1^2 + 4^2 = 27 = 3*3^2.
For the case r = 3 and m = 5, we again have 12*a(3) = 24 because of (3,3,3,3) - (-3,1,1,4) = (6,2,2,-1) and (3,3,3,3) - (-1,-1,0,5) = (4,4,3,-2) (12 permutations each). For example, 6 + 2 + 2 + (-1) = 9 = 3*3 and 6^2 + 2^2 + 2^2 + (-1)^2  = 45 = 5*3^2.
		

Crossrefs

Programs

  • Mathematica
    sqrtint = Floor[Sqrt[#]]&;
    q[r_, s_, g_] := Module[{d = 2s - r^2, h}, If[d <= 0, d == 0 && Mod[r, 2] == 0 && GCD[g, r/2] == 1, h = Sqrt[d]; If[IntegerQ[h] && Mod[r+h, 2] == 0 && GCD[g, GCD[(r+h)/2, (r-h)/2]]==1, 2, 0]]] /. {True -> 1, False -> 0};
    a[n_] := Module[{s = 3n^2}, Sum[q[n - i - j, s - i^2 - j^2, GCD[i, j]], {i, -sqrtint[s], sqrtint[s]}, {j, -sqrtint[s - i^2], sqrtint[s - i^2]}]/12];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* Jean-François Alcover, Sep 20 2020, after Andrew Howroyd *)
  • PARI
    q(r, s, g)={my(d=2*s - r^2); if(d<=0, d==0 && r%2==0 && gcd(g, r/2)==1, my(h); if(issquare(d, &h) && (r+h)%2==0 && gcd(g, gcd((r+h)/2, (r-h)/2))==1, 2, 0))}
    a(n)={my(s=3*n^2); sum(i=-sqrtint(s), sqrtint(s), sum(j=-sqrtint(s-i^2), sqrtint(s-i^2), q(n-i-j, s-i^2-j^2, gcd(i,j)) ))/12} \\ Andrew Howroyd, Aug 02 2018

Extensions

Example section edited by Petros Hadjicostas, Apr 21 2020

A278083 a(n) is 1/6 of the number of primitive integral quadruples with sum = 2*m and sum of squares = 2*m^2, where m = 2*n-1.

Original entry on oeis.org

1, 4, 4, 8, 12, 12, 12, 16, 16, 20, 32, 24, 20, 36, 28, 32, 48, 32, 36, 48, 40, 44, 48, 48, 56, 64, 52, 48, 80, 60, 60, 96, 48, 68, 96, 72, 72, 80, 96, 80, 108, 84, 64, 112, 88, 96, 128, 80, 96, 144, 100, 104, 128, 108, 108, 144, 112, 96, 144, 128, 132, 160
Offset: 1

Views

Author

Colin Mallows, Nov 14 2016

Keywords

Comments

Set b(m) = a(n) for m = 2*n-1, and b(m) = 0 for m even.
Conjecture: b(m) is multiplicative: for k >= 1, b(2^k) = 0; b(p^k) = p^(k-1)*b(p) for p an odd prime; b(p) = p+1 for p == 3 (mod 4); b(p) = p-1 for p == 1 (mod 4). It would be nice to have a proof of this.

Examples

			6*a(2) = 24 = 6*b(3) because of (-1,2,2,3) and (0,1,1,4) (12 permutations each). For example, (-1) + 2 + 2 + 3 = 6 = 2*3 and (-1)^2 + 2^2 + 2^2 + 3^2 = 18 = 2*3^2 (with n = 2 and m = 3 = 2*n - 1).
		

Crossrefs

Programs

  • Mathematica
    sqrtint = Floor[Sqrt[#]]&;
    q[r_, s_, g_] := Module[{d = 2 s - r^2, h}, If[d <= 0, d == 0 && Mod[r, 2] == 0 && GCD[g, r/2] == 1, h = Sqrt[d]; If[IntegerQ[h] && Mod[r + h, 2]==0 && GCD[g, GCD[(r+h)/2, (r-h)/2]]==1, 2, 0]]] /. {True -> 1, False -> 0};
    a[n_] := Module[{m = 2n - 1, s}, s = 2m^2; Sum[q[2m - i - j, s - i^2 - j^2, GCD[i, j]] , {i, -sqrtint[s], sqrtint[s]}, {j, -sqrtint[s - i^2], sqrtint[s - i^2]}]/6];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* Jean-François Alcover, Sep 20 2020, after Andrew Howroyd *)
  • PARI
    q(r, s, g)={my(d=2*s - r^2); if(d<=0, d==0 && r%2==0 && gcd(g, r/2)==1, my(h); if(issquare(d, &h) && (r+h)%2==0 && gcd(g, gcd((r+h)/2, (r-h)/2))==1, 2, 0))}
    a(n)={my(m=2*n-1, s=2*m^2); sum(i=-sqrtint(s), sqrtint(s), sum(j=-sqrtint(s-i^2), sqrtint(s-i^2), q(2*m-i-j, s-i^2-j^2, gcd(i,j)) ))/6} \\ Andrew Howroyd, Aug 02 2018

Extensions

Terms a(51) and beyond from Andrew Howroyd, Aug 02 2018
Name and example section edited by Petros Hadjicostas, Apr 21 2020

A278084 a(n) is 1/24 of the number of primitive integral quadruples with sum = 2*m and sum of squares = 6*m^2, where m = 2*n-1.

Original entry on oeis.org

1, 2, 5, 6, 6, 12, 14, 10, 18, 20, 12, 22, 25, 18, 28, 32, 24, 30, 38, 28, 40, 42, 30, 46, 42, 36, 54, 60, 40, 60, 60, 36, 70, 66, 44, 72, 74, 50, 72, 80, 54, 82, 90, 56, 88, 84, 64, 100, 98, 72, 100, 102, 60, 106, 108, 76, 114, 110, 84, 108, 132, 80, 125, 126
Offset: 1

Views

Author

Colin Mallows, Nov 14 2016

Keywords

Comments

Set b(m) = a(n) for m = 2*n-1, and b(m) = 0 for m even.
Conjecture: b(m) is multiplicative: for k >= 1, b(2^k) = 0, and for p an odd prime, b(p^k) = p^(k-1)*b(p), with b(p) = p + 1 for p == (11, 13, 17, 19) (mod 20), b(p) = p - 1 for p == (1, 3, 7, 9) (mod 20), b(5) = 5. It would be nice to have a proof of this.

Examples

			24*a(2) = 48 = 24*b(3) because of (-4,2,3,5) and (-2,0,1,7) (24 permutations each). For example, (-2) + 0 + 1 + 7 = 6 = 2*3 and (-2)^2 + 0^2 + 1^2 + 7^2 = 54 = 6*3^2 (with n = 2 and m = 3 = 2*2 - 1).
		

Crossrefs

Programs

  • Mathematica
    sqrtint = Floor[Sqrt[#]]&;
    q[r_, s_, g_] := Module[{d = 2s - r^2, h}, If[d <= 0, d == 0 && Mod[r, 2] == 0 && GCD[g, r/2] == 1, h = Sqrt[d]; If[IntegerQ[h] && Mod[r+h, 2] == 0 && GCD[g, GCD[(r+h)/2, (r-h)/2]]==1, 2, 0]]] /. {True -> 1, False -> 0};
    a[n_] := Module[{m = 2n - 1, s}, s = 6m^2; Sum[q[2m - i - j, s - i^2 - j^2, GCD[i, j]] , {i, -sqrtint[s], sqrtint[s]}, {j, -sqrtint[s - i^2], sqrtint[s - i^2]}]/24];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* Jean-François Alcover, Sep 20 2020, after Andrew Howroyd *)
  • PARI
    q(r, s, g)={my(d=2*s - r^2); if(d<=0, d==0 && r%2==0 && gcd(g, r/2)==1, my(h); if(issquare(d, &h) && (r+h)%2==0 && gcd(g, gcd((r+h)/2, (r-h)/2))==1, 2, 0))}
    a(n)={my(m=2*n-1, s=6*m^2); sum(i=-sqrtint(s), sqrtint(s), sum(j=-sqrtint(s-i^2), sqrtint(s-i^2), q(2*m-i-j, s-i^2-j^2, gcd(i,j)) ))/24} \\ Andrew Howroyd, Aug 02 2018

Extensions

Terms a(51) and beyond from Andrew Howroyd, Aug 02 2018
Name and example section edited by Petros Hadjicostas, Apr 21 2020

A354766 1/4 of the total number of integral quadruples with sum = n and sum of squares = n^2.

Original entry on oeis.org

1, 2, 4, 2, 7, 8, 7, 2, 13, 14, 13, 8, 13, 14, 28, 2, 19, 26, 19, 14, 28, 26, 25, 8, 37, 26, 40, 14, 31, 56, 31, 2, 52, 38, 49, 26, 37, 38, 52, 14, 43, 56, 43, 26, 91, 50, 49, 8, 49, 74, 76, 26, 55, 80, 91, 14, 76, 62, 61, 56, 61, 62, 91, 2, 91, 104, 67, 38, 100, 98, 73, 26, 73, 74, 148, 38, 91, 104, 79, 14, 121, 86, 85, 56
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2022, based on an email from Colin Mallows, Jun 12 2022

Keywords

Comments

If instead we count only primitive quadruples (meaning quadruples (h,i,j,k) with gcd(h,i,j,k) = 1) we get A278085(n).
Conjectures from Colin Mallows, Jun 12 2022: (Start)
Given a natural number n, a "quad" for n is a quadruple q = (h,i,j,k) of integers with sum(q) = h+i+j+k = n and sum(q^2) = h^2+i^2+j^2+k^2 = n^2.
A quad q is "primitive" if gcd(h,i,j,k) = 1. Define pq(n) = A278085(n) to be the number of distinct primitive quads for n, and tq(n) (the present sequence) to be the total number of quads for n.
Conjecture 1: (Based on the data for n <= 5000) pq/4 and tq/4 are multiplicative sequences.
Conjecture 2: When n = p^k, p prime and k >= 1:
if p = 2, k = 1 then pq(q)/4 = 1 and tq(n)/4 = 2;
if p = 2, k >= 2 then pq(q)/4 = 0 and tq(n)/4 = 2;
if p = 3, k >= 1 then pq(q)/4 = n and tq(n)/4 = (3*n-1)/2;
if p == 5 (mod 6), k >= 1 then pq(q)/4 = (p+1)*n/p and tq(n)/4 = n + 2*(n-1)/(p-1);
if p == 1 (mod 6), k >= 1 then pq(q)/4 = (p-1)*n/p and tq(n)/4 = n.
(End)
Conjecture: the numbers n for which a(n) = n have a positive asymptotic density.

Examples

			Solutions for n = 1: (1,0,0,0) and all permutations thereof.
n=2: (2,0,0,0) and (1,1,1,-1).
n=3: (3,0,0,0) and (2,2,-1,0).
n=4: (4,0,0,0) and (2,2,2,-2). Eight solutions, so a(4) = 8/4 = 2. None are primitive, so A278085(4) = 0.
n=5: (5,0,0,0) and (4,2,-2,1). 4+24 solutions, so a(5) = 28/4 = 7. 24 are primitive, so A278085(5) = 24/4 = 6.
		

Crossrefs

See also A353589 (counts nondecreasing nonnegative (h,i,j,k) such that (+-h, +-i, +-j, +-k) is a solution).

Programs

  • Maple
    f:= proc(n) local d; add(g3(n-d, n^2 - d^2), d=-n .. n)/4 end proc:
    g3:= proc(x,y) option remember; local m,c;
       if x^2 > 3*y then return 0 fi;
       m:= floor(sqrt(y));
       add(g2(x-c,y - c^2), c=- m.. m)
    end proc:
    g2:= proc(x,y) option remember;
       local v;
       v:= 2*y - x^2;
       if not issqr(v) then 0
       elif v = 0 then 1
       else 2
       fi
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 16 2023
  • Mathematica
    f[n_] := Sum[g3[n - d, n^2 - d^2], {d, -n, n}]/4 ;
    g3[x_, y_] := g3[x, y] = Module[{m}, If[x^2 > 3*y, 0, m = Floor[Sqrt[y]]; Sum[g2[x - c, y - c^2], {c, -m, m}]]];
    g2[x_, y_] := g2[x, y] = Module[{v}, v = 2*y - x^2; Which[!IntegerQ@Sqrt[v], 0, v == 0, 1, True, 2]];
    f /@ Range[100] (* Jean-François Alcover, Mar 09 2023, after Robert Israel *)

A354778 Number of integer quadruples (u,v,w,x) such that u^2+v^2+w^2+x^2 = n^2 and u+v+w+x = n.

Original entry on oeis.org

1, 4, 8, 16, 8, 28, 32, 28, 8, 52, 56, 52, 32, 52, 56, 112, 8, 76, 104, 76, 56, 112, 104, 100, 32, 148, 104, 160, 56, 124, 224, 124, 8, 208, 152, 196, 104, 148, 152, 208, 56, 172, 224, 172, 104, 364, 200, 196, 32, 196, 296, 304, 104, 220, 320, 364, 56, 304, 248, 244, 224, 244, 248, 364, 8, 364, 416, 268, 152, 400, 392, 292, 104, 292, 296, 592, 152, 364, 416, 316, 56, 484, 344, 340, 224
Offset: 0

Views

Author

N. J. A. Sloane, Jun 27 2022

Keywords

Comments

This has the most natural offset, 0, just as A000118 does. A354766 gives one-quarter of a(n) for n > 0, and A278085 counts primitive solutions.

Crossrefs

a(n) = A354777(n^2,n).

Formula

See A278085 and A354766 for some conjectural formulas.

A354777 Irregular triangle read by rows: T(n,k) is the number of integer quadruples (u,v,w,x) such that u^2+v^2+w^2+x^2 = n and u+v+w+x = k (n>=0, 0 <= k <= A307531(n)).

Original entry on oeis.org

1, 0, 4, 12, 0, 6, 0, 12, 0, 4, 6, 0, 8, 0, 1, 0, 12, 0, 12, 24, 0, 24, 0, 12, 0, 16, 0, 12, 0, 4, 12, 0, 0, 0, 6, 0, 24, 0, 16, 0, 12, 24, 0, 30, 0, 24, 0, 6, 0, 12, 0, 24, 0, 12, 8, 0, 24, 0, 12, 0, 8, 0, 24, 0, 12, 0, 16, 0, 4, 48, 0, 24, 0, 24, 0, 24, 0, 36, 0, 24, 0, 24, 0, 12, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 12, 0, 36, 0, 12, 0, 12
Offset: 0

Views

Author

N. J. A. Sloane, Jun 27 2022

Keywords

Comments

Row n has width A307531(n).

Examples

			The triangle begins:
[1],
[0, 4],
[12, 0, 6],
[0, 12, 0, 4],
[6, 0, 8, 0, 1],
[0, 12, 0, 12],
[24, 0, 24, 0, 12],
[0, 16, 0, 12, 0, 4],
[12, 0, 0, 0, 6],
[0, 24, 0, 16, 0, 12],
[24, 0, 30, 0, 24, 0, 6],
[0, 12, 0, 24, 0, 12],
[8, 0, 24, 0, 12, 0, 8],
[0, 24, 0, 12, 0, 16, 0, 4],
[48, 0, 24, 0, 24, 0, 24],
[0, 36, 0, 24, 0, 24, 0, 12],
[6, 0, 0, 0, 8, 0, 0, 0, 1],
[0, 12, 0, 36, 0, 12, 0, 12],
[36, 0, 48, 0, 48, 0, 30, 0, 12],
...
T(4,2) = 8 from the solutions (u,v,w,x) = (2,0,0,0) (4 such) and (1,1,1,-1) (4 such).
		

Crossrefs

T(n^2,n) = A354778(n). See also A278085 and A354766.

A353589 Number of nondecreasing nonnegative integer quadruples (m,p,q,r) such that m^2 + p^2 + q^2 + r^2 = n^2 and m +- p +- q +- r = +- n.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 4, 2, 2, 4, 4, 4, 4, 3, 4, 6, 2, 5, 8, 5, 4, 6, 8, 5, 4, 7, 6, 9, 4, 6, 12, 6, 2, 12, 10, 9, 8, 7, 10, 10, 4, 9, 12, 9, 8, 17, 10, 9, 4, 9, 14, 16, 6, 10, 18, 17, 4, 16, 12, 12, 12, 11, 12, 17, 2, 16, 24, 13, 10, 18, 18, 13, 8, 14, 14, 26, 10, 17, 20, 14, 4, 23
Offset: 0

Views

Author

M. F. Hasler, Jun 20 2022

Keywords

Comments

Motivated by A354766 and A278085.

Examples

			For n = 1, (0, 0, 0, 1) is the only solution.
For n = 2, (0, 0, 0, 2) and (1, 1, 1, 1) are solutions, with 1 + 1 + 1 - 1 = 2.
		

Crossrefs

Programs

  • PARI
    apply( {A353589(n, show=0, cnt=0, n2=n^2, e=[1,-1]~)=
      for(a=0,sqrtint(n2\4), for(b=a,sqrtint((n2-a^2)\3),
        my(s=[a+b, b-a, a-b, -a-b]); foreach(sum2sqr(n2-a^2-b^2), cd, cd[1] >= b &&
          vecsum(cd)+s[1] >= n && foreach(s, d, (vecsum(cd)+d==n || abs(cd*e+d)==n)&&
            cnt++&& !(show && print1(concat([a, b], cd)))&& break)))); cnt}, [0..99]) \\ See A133388 for sum2sqr().
Showing 1-9 of 9 results.