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.

A278085 1/4 of the number of primitive integral quadruples with sum = 3*n and sum of squares = 3*n^2.

This page as a plain text file.
%I A278085 #47 Jun 27 2022 19:31:23
%S A278085 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,
%T A278085 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,
%U A278085 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
%N A278085 1/4 of the number of primitive integral quadruples with sum = 3*n and sum of squares = 3*n^2.
%C A278085 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 == 5 (mod 6), a(p) = p-1 for p=1 (mod 6), and a(3) = 3.  It would be nice to have a proof of this. [See A354766 for additional conjectures. - _N. J. A. Sloane_, Jun 19 2022]
%C A278085 This is also 1/4 of the number of primitive integral quadruples with sum = n and sum of squares = n^2. See A354766, A354777, A354778 for the total number of solutions. - _N. J. A. Sloane_, Jun 27 2022
%H A278085 Andrew Howroyd, <a href="/A278085/b278085.txt">Table of n, a(n) for n = 1..500</a>
%H A278085 Petros Hadjicostas, <a href="/A278081/a278081.r.txt">Slight modification of Mallows' R program</a>. [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.]
%H A278085 Colin Mallows, <a href="/A278081/a278081_2.txt">R programs for A278081-A278086</a>.
%e A278085 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.
%e A278085 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.
%t A278085 sqrtint = Floor[Sqrt[#]]&;
%t A278085 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};
%t A278085 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];
%t A278085 Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* _Jean-François Alcover_, Sep 20 2020, after _Andrew Howroyd_ *)
%o A278085 (PARI)
%o A278085 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))}
%o A278085 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
%Y A278085 Cf. A046897, A278081, A278082, A278083, A278084, A278086, A354766, A353589, A354777, A354778.
%K A278085 nonn
%O A278085 1,3
%A A278085 _Colin Mallows_, Nov 14 2016
%E A278085 Example edited by _Petros Hadjicostas_, Apr 21 2020