A278085
1/4 of the number of primitive integral quadruples with sum = 3*n and sum of squares = 3*n^2.
Original entry on oeis.org
1, 1, 3, 0, 6, 3, 6, 0, 9, 6, 12, 0, 12, 6, 18, 0, 18, 9, 18, 0, 18, 12, 24, 0, 30, 12, 27, 0, 30, 18, 30, 0, 36, 18, 36, 0, 36, 18, 36, 0, 42, 18, 42, 0, 54, 24, 48, 0, 42, 30, 54, 0, 54, 27, 72, 0, 54, 30, 60, 0, 60, 30, 54, 0, 72, 36, 66, 0, 72, 36, 72, 0, 72, 36, 90, 0, 72, 36, 78, 0, 81, 42, 84, 0, 108, 42, 90, 0, 90, 54, 72, 0, 90, 48, 108, 0, 96, 42, 108, 0
Offset: 1
For the case r = s = 3, we have 4*a(3) = 12 because of (1,1,3,4) (12 permutations). Indeed, 1 + 1 + 3 + 4 = 9 = 3*3 and 1^2 + 1^2 + 3^2 + 4^2 = 27 = 3*3^2.
For the case r = s = 1, we have again 4*a(3) = 12 because of (3,3,3,3) - (1,1,3,4) = (2,2,0,-1) (12 permutations). Indeed, 2 + 2 + 0 + (-1) = 3 = 1*3 and 2^2 + 2^2 + 0^2 + (-1)^2 = 9 = 1*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, 3), where r = 3 and s = 3. To get the 1/4 of these counts, type gc(1:120, 3, 3)[,3]/4. As stated in the comments, we get the same sequence with r = 1 and s = 1, i.e., we may type gc(1:120, 1, 1)[,3]/4.]
- 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 = 3 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]}]/4];
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(3*n-i-j, s-i^2-j^2, gcd(i,j)) ))/4} \\ 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 *)
A354780
a(n) is the bitwise OR of (the binary expansions of) b(n+1) to b(2*n), where b is A354169.
Original entry on oeis.org
2, 12, 27, 115, 252, 1004, 2013, 4031, 16307, 32631, 65279, 261375, 524270, 2096110, 4194253, 8386527, 16773119, 67096575, 134217659, 536854459, 1073741623, 2147450751, 4294901759, 17179672575, 34359737599, 137438690559, 274877382143, 549754765311, 2199022205950, 4398044412927, 8796093022189, 35184367894509, 70368744175567
Offset: 1
Consider n=6. Then b(7) to b(12) are 32, 64, 12, 128, 256, 512. The bitwise OR of those 6 numbers is 1111101100_2 = 1004_10 = a(6). The bitwise complement of 1004_10 is 10011_2 = 19_10 = A354781(6), and A354169(6) = 17_10 = 10001_2.
On the other hand, for n=5, b(6) to b(10) are 16, 32, 64, 12, 128, whose bitwise OR is 11111100_2 = 252_10 = a(5). The bitwise complement of 252_10 is 3_10 = 11_2 = A354781(5). However, 3 has already appeared in A354169, and the smallest available number whose binary expansion is disjoint from 252_10 = 11111100_2 is 2^8 = 100000000_2 = 256_10 = 2^8 = A354169(5).
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).
A354781
If the binary expansion of A354780(n) is 1 d_1 d_2 ... d_k, then the binary expansion of a(n) is c_1 c_2 ... c_k, where c_i = 1 - d_i.
Original entry on oeis.org
1, 3, 4, 12, 3, 19, 34, 64, 76, 136, 256, 768, 17, 1041, 50, 2080, 4096, 12288, 68, 16452, 200, 32896, 65536, 196608, 768, 262912, 524800, 1048576, 1049601, 2098176, 18, 4194322, 2096, 8390656, 16777216, 50331648, 12288, 67121152, 134225920, 268435456, 268451844, 536887296, 72, 1073741896, 32960, 2147516416, 4294967296, 12884901888
Offset: 1
Showing 1-5 of 5 results.
Comments