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
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).
- Andrew Howroyd, Table of n, a(n) for n = 1..500
- Petros Hadjicostas, Slight modification of Mallows' R program. [To get the total counts for n = 1 to 120, with the zeros, i.e., the sequence (b(n): n >= 1) shown in the comments above, type gc(1:120, 0, 2), where r = 0 and s = 2. To get the 1/12 of these counts with no zeros, type gc(seq(1,59,2), 0, 2)[,3]/12. As stated in the comments, we get the same sequence with r = 4 and s = 6, i.e., we may type gc(seq(1,59,2), 4, 6)[,3]/12.]
- Colin Mallows, R programs for A278081-A278086.
-
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 *)
-
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
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
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.
- Andrew Howroyd, Table of n, a(n) for n = 1..500
- Petros Hadjicostas, Slight modification of Mallows' R program. [To get the total counts for n = 1 to 120, type gc(1:120, 3, 7), where r = 3 and s = 7. To get the 1/12 of these counts, type gc(1:120, 3, 7)[,3]/12. As stated in the comments, we get the same sequence with r = 1 and s = 5, i.e., we may type gc(1:120, 1, 5)[,3]/12.]
- Colin Mallows, R programs for A278081-A278086.
-
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 *)
-
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
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
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.
- Andrew Howroyd, Table of n, a(n) for n = 1..500
- Petros Hadjicostas, Slight modification of Mallows' R program. [To get the total counts for n = 1 to 120, type gc(1:120, 1, 3), where r = 1 and s = 3. To get the 1/12 of these counts, type gc(1:120, 1, 3)[,3]/12. As stated in the comments, we get the same sequence with r = 3 and s = 5, i.e., we may type gc(1:120, 3, 5)[,3]/12.]
- Colin Mallows, R programs for A278081-A278086.
-
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 *)
-
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
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
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).
- Andrew Howroyd, Table of n, a(n) for n = 1..500
- Petros Hadjicostas, Slight modification of Mallows' R program. [To get the total counts for n = 1 to 120, with the zeros, i.e., the sequence (b(n): n >= 1) shown in the comments above, type gc(1:120, 2, 2), where r = 2 and s = 2. To get the 1/6 of these counts with no zeros, type gc(seq(1,59,2), 2, 2)[,3]/6.]
- Colin Mallows, R programs for A278081-A278086.
-
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 *)
-
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
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
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).
- Andrew Howroyd, Table of n, a(n) for n = 1..500
- Petros Hadjicostas, Slight modification of Mallows' R program. [To get the total counts for n = 1 to 120, with the zeros, i.e., the sequence (b(n): n >= 1) shown in the comments above, type gc(1:120, 2, 6), where r = 2 and s = 6. To get the 1/24 of these counts with no zeros, type gc(seq(1,59,2), 2, 6)[,3]/24.]
- Colin Mallows, R programs for A278081-A278086.
-
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 *)
-
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
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
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.
See also
A353589 (counts nondecreasing nonnegative (h,i,j,k) such that (+-h, +-i, +-j, +-k) is a solution).
-
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
-
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
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
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).
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
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.
-
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.
Comments