%I #10 Nov 02 2015 11:01:31
%S 1,1,1,2,2,2,3,1,1,5,2,2,4,3,4,2,4,2,4,4,2,7,1,4,6,4,3,5,6,1,8,5,2,3,
%T 4,4,5,5,3,9,3,5,5,1,3,6,7,1,5,4,4,5,4,2,6,6,3,8,4,5,4,7,2,5,8,4,11,2,
%U 4,7,4,2,7,9,3,5,7,4,4,10,5,8,4,4,11,4,7,8,4,5,9,11,3,8,9,2,7,2,4,8
%N Number of ways to write n as x^2 + y*(2*y+1) + z*(z+1)/2 where x, y and z are nonnegative integers with z or z+1 prime.
%C Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 2, 3, 8, 9, 23, 30, 44, 48, 198, 219, 1344.
%C (ii) Any positive integer n not equal to 8 can be written as x*(2*x+1) + y*(y+1)/2 + z*(z+1)/2, where x, y and z are nonnegative integers with z or z+1 prime.
%C (iii) Any integer n > 1 can be written as x^2 + y*(y+1) + z*(z+1) (or 2*x^2 + y*(y+1)/2 + z*(z+1)), where x, y and z are nonnegative integers with z or z+1 prime.
%C (iv) Each integer n > 2 can be written as x^2 + y*(y+1)/2 + 3*z*(z+1)/2, where x, y and z are nonnegative integers with z or z+1 prime.
%C (v) Every n = 1,2,3,... can be written as 2*x^2 + y*(y+1)/2 + z*(z+1)/2, where x, y and z are nonnegative integers with z or z+1 prime. Also, any integer n > 4 can be written as 2*x^2 + y*(y+1) + z*(z+1)/2, where x, y and z are nonnegative integers with z or z+1 prime.
%C Note that the integers n*(2*n+1) = 2n*(2n+1)/2 (n = 0,1,2,...) are second hexagonal numbers.
%C See also A262785, A263998 and A264010 for similar conjectures.
%H Zhi-Wei Sun, <a href="/A264025/b264025.txt">Table of n, a(n) for n = 1..10000</a>
%H Zhi-Wei Sun, <a href="http://dx.doi.org/10.4064/aa127-2-1">Mixed sums of squares and triangular numbers</a>, Acta Arith. 127(2007), 103-113.
%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1502.03056">On universal sums ax^2+by^2+f(z), aT_x+bT_y+f(z) and aT_x+by^2+f(z)</a>, arXiv:1502.03056 [math.NT], 2015.
%e a(1) = 1 since 1 = 0^2 + 0*(2*0+1) + 1*2/2 with 2 prime.
%e a(2) = 1 since 2 = 1^2 + 0*(2*0+1) + 1*2/2 with 2 prime.
%e a(3) = 1 since 3 = 0^2 + 0*(2*0+1) + 2*3/2 with 2 prime.
%e a(8) = 1 since 8 = 2^2 + 1*(2*1+1) + 1*2/2 with 2 prime.
%e a(9) = 1 since 9 = 0^2 + 1*(2*1+1) + 3*4/2 with 3 prime.
%e a(23) = 1 since 23 = 1^2 + 3*(2*3+1) + 1*2/2 with 2 prime.
%e a(30) = 1 since 30 = 3^2 + 0*(2*0+1) + 6*7/2 with 7 prime.
%e a(44) = 1 since 44 = 4^2 + 0*(2*0+1) + 7*8/2 with 7 prime.
%e a(48) = 1 since 48 = 3^2 + 4*(2*4+1) + 2*3/2 with 2 prime.
%e a(198) = 1 since 198 = 3^2 + 4*(2*4+1) + 17*18/2 with 17 prime.
%e a(219) = 1 since 219 = 6^2 + 7*(2*7+1) + 12*13/2 with 13 prime.
%e a(1344) = 1 since 1344 = 21^2 + 0*(2*0+1) + 42*43/2 with 43 prime.
%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
%t Do[r=0;Do[If[(PrimeQ[z]||PrimeQ[z+1])==False,Goto[aa]];Do[If[SQ[n-z(z+1)/2-y(2y+1)],r=r+1],{y,0,(Sqrt[8(n-z(z+1)/2)+1]-1)/4}];Label[aa];Continue,{z,1,(Sqrt[8n+1]-1)/2}];Print[n, " ", r];Continue, {n,1,100}]
%Y Cf. A000040, A000217, A000290, A014105, A262785, A263998, A264010.
%K nonn
%O 1,4
%A _Zhi-Wei Sun_, Nov 01 2015