login
Number of ways to write 6*n+2 as an unordered sum of four squares of elements in the set {m >= 0: m = 0 or 2*m is practical}.
2

%I #16 Nov 21 2025 08:15:21

%S 1,1,1,2,2,1,2,1,2,1,1,2,2,2,2,2,3,3,3,2,3,1,2,2,4,3,2,4,3,2,5,2,2,5,

%T 2,3,5,1,4,4,5,3,3,4,4,4,5,2,7,5,3,5,4,2,6,4,5,5,5,5,6,3,5,3,3,7,2,5,

%U 6,3,7,4,7,6,4,7,5,4,7,4,9,7,4,6,6,1,7,5,6,6,4,5,8,4,7,4,6,7,6,6,6

%N Number of ways to write 6*n+2 as an unordered sum of four squares of elements in the set {m >= 0: m = 0 or 2*m is practical}.

%C Conjecture: Let S be the set of those natural numbers m such that 2*m is either zero or practical. Then any integer n >= 0 with n == 0,1 (mod 4) or n == 2,4 (mod 6) can be written as w^2 + x^2 + y^2 + z^2 with w,x,y,z in the set S.

%C This has been verified for n <= 6*10^5.

%C See also A389523 for related conjectures.

%H Zhi-Wei Sun, <a href="/A390730/b390730.txt">Table of n, a(n) for n = 0..10000</a>

%H Zhi-Wei Sun, <a href="https://doi.org/10.1016/j.jnt.2016.11.008">Refining Lagrange's four-square theorem</a>, J. Number Theory 175(2017), 167-190.

%e a(0) = 1 since 6*0 + 2 = 0^2 + 0^2 + 1^2 + 1^2 with 2*1 = 2 practical.

%e a(2) = 1 since 6*2 + 2 = 14 = 0^2 + 1^2 + 2^2 + 3^2 with 2*1 = 2, 2*2 = 4 and 2*6 = 6 all practical.

%e a(10) = 1 since 6*10 + 2 = 62 = 1^2 + 3^2 + 4^2 + 6^2 with 2*1 = 2, 2*3 = 6, 2*4 = 8 and 2*6 = 12 all practical.

%e a((4^k-1)/3) = 1 since 6*(4^k-1)/3 + 2 = 2^(2k+1) = 0^2 + 0^2 + (2^k)^2 + (2^k)^2 with 2*2^k = 2^(k+1) practical.

%e a((7*4^k-1)/3) = 1 since 6*(7*4^k-1)/3 + 2 = 14*4^k = 0^2 + (2^k)^2 + (2^(k+1))^2 + (3*2^k)^2 with 2*2^k, 2*2^(k+1) and 6*2^k all practical.

%t f[n_]:=f[n]=FactorInteger[n];

%t Pow[n_, i_]:=Pow[n,i]=Part[Part[f[n], i], 1]^(Part[Part[f[n], i], 2]);

%t Con[n_]:=Con[n]=Sum[If[Part[Part[f[n], s+1], 1]<=DivisorSigma[1, Product[Pow[n, i], {i, 1, s}]]+1, 0, 1], {s, 1, Length[f[n]]-1}];

%t pr[n_]:=pr[n]=n>0&&(n<3||Mod[n, 2]+Con[n]==0);

%t pq[n_]:=pq[n]=IntegerQ[n]&&(n==0||pr[2n]);

%t tab={};Do[m=0;Do[If[pq[x]&&pq[y]&&pq[z]&&pq[Sqrt[6n+2-x^2-y^2-z^2]],m=m+1],{x,0,Sqrt[(6n+2)/4]},{y,x,Sqrt[(6n+2-x^2)/3]},{z,y,Sqrt[(6n+2-x^2-y^2)/2]}];tab=Append[tab,m],{n,0,100}];Print[tab]

%Y Cf. A000290, A005153, A271518, A389523.

%K nonn

%O 0,4

%A _Zhi-Wei Sun_, Nov 16 2025