%I #14 Nov 01 2015 11:16:36
%S 0,0,1,1,1,1,2,2,3,1,1,4,4,2,1,5,4,3,3,1,6,5,4,4,4,3,6,5,1,6,7,5,4,7,
%T 4,4,7,3,6,5,5,5,6,5,5,6,3,6,9,2,4,10,2,4,3,5,9,8,6,3,10,5,5,4,4,9,8,
%U 5,4,8,7,8,7,2,5,10,6,3,8,4,6,8,3,10,6,7,7,6,5,5,5,2,10,10,4,4,11,6,5,6
%N Number of ways to write n as x^2 + y*(y+1) + z*(z+1)/2, where x, y and z are nonnegative integers such that y or y+1 is prime, and z or z+1 is prime.
%C Conjectures: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 4, 5, 6, 10, 11, 15, 20, 29, 1125.
%C (ii) Any integer n > 2 can be written as x*(x+1) + y*(y+1)/2 + z*(z+1)/2, where x, y and z are nonnegative integers such that x or x+1 is prime, and y or y+1 is prime.
%C (iii) Any integer n > 7 can be written as x*(x+1) + y*(y+1)/2 + 3*z*(z+1)/2, where x, y and z are nonnegative integers such that y or y+1 is prime, and z or z+1 is prime.
%C It is known that any natural number can be written as x^2 + y*(y+1)+ z*(z+1)/2 (or x*(x+1) + y*(y+1)/2 + z*(z+1)/2, or x*(x+1) + y*(y+1)/2 + 3*z(z+1)/2) with x, y and z nonnegative integers.
%C See also A264025 for similar conjectures.
%H Zhi-Wei Sun, <a href="/A264010/b264010.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.
%e a(5) = 1 since 5 = 0^2 + 1*2 + 2*3/2 with 2 prime.
%e a(6) = 1 since 6 = 1^2 + 1*2 + 2*3/2 with 2 prime.
%e a(10) = 1 since 10 = 1^2 + 2*3 + 2*3/2 with 2 prime.
%e a(11) = 1 since 11 = 2^2 + 2*3 + 1*2/2 with 2 prime.
%e a(15) = 1 since 15 = 0^2 + 3*4 + 2*3/2 with 3 prime.
%e a(20) = 1 since 20 = 2^2 + 2*3 + 4*5/2 with 2 and 5 both prime.
%e a(29) = 1 since 29 = 4^2 + 3*4 + 1*2/2 with 3 and 2 both prime.
%e a(1125) = 1 since 1125 = 33^2 + 5*6 + 3*4/2 with 5 and 3 both prime.
%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
%t Do[r=0;Do[If[(PrimeQ[y]||PrimeQ[y+1])==False,Goto[aa]];Do[If[(PrimeQ[z]||PrimeQ[z+1])&&SQ[n-y(y+1)-z(z+1)/2],r=r+1],{z,1,(Sqrt[8(n-y(y+1))+1]-1)/2}];Label[aa];Continue,{y,1,(Sqrt[4n+1]-1)/2}];Print[n, " ", r];Continue, {n,1,100}]
%Y Cf. A000040, A000217, A000290, A262785, A263998, A264025.
%K nonn
%O 1,7
%A _Zhi-Wei Sun_, Oct 31 2015