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.

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

This page as a plain text file.
%I A278082 #47 Sep 20 2020 08:19:50
%S A278082 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,
%T A278082 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,
%U A278082 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
%N A278082 1/12 of the number of primitive quadruples with sum = n and sum of squares = 3*n^2.
%C A278082 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.
%C A278082 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]
%H A278082 Andrew Howroyd, <a href="/A278082/b278082.txt">Table of n, a(n) for n = 1..500</a>
%H A278082 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, 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.]
%H A278082 Colin Mallows, <a href="/A278081/a278081_2.txt">R programs for A278081-A278086</a>.
%e A278082 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.
%e A278082 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.
%t A278082 sqrtint = Floor[Sqrt[#]]&;
%t A278082 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};
%t A278082 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];
%t A278082 Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 100}] (* _Jean-François Alcover_, Sep 20 2020, after _Andrew Howroyd_ *)
%o A278082 (PARI)
%o A278082 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 A278082 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
%Y A278082 Cf. A046897, A278081, A278083, A278084, A278085, A278086.
%K A278082 nonn
%O A278082 1,3
%A A278082 _Colin Mallows_, Nov 14 2016
%E A278082 Example section edited by _Petros Hadjicostas_, Apr 21 2020