A270966 Number of ways to write n as x^2 + y^2 + z*(3z+1)/2, where x, y and z are integers with 0 <= x <= y such that x or y has the form p-1 with p prime.
1, 2, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 3, 2, 3, 3, 5, 3, 2, 4, 2, 3, 3, 2, 4, 3, 5, 4, 2, 4, 4, 5, 2, 3, 2, 4, 5, 4, 5, 3, 6, 6, 4, 4, 4, 3, 4, 5, 1, 3, 5, 8, 5, 3, 6, 3, 4, 4, 4, 4, 4, 5, 3, 3, 6, 5, 8, 4, 2, 4
Offset: 1
Keywords
Examples
a(1) = 1 since 1 = 0^2 + (2-1)^2 + 0*(3*0+1)/2 with 2 prime. a(12) = 2 since 12 = (2-1)^2 + 2^2 + 2*(2*3+1)/2 = (2-1)^2 + 3^2 + 1*(3*1+1)/2 with 2 prime. a(49) = 1 since 49 = (2-1)^2 + 6^2 + (-3)*(3*(-3)+1)/2 with 2 prime. a(608) = 1 since 608 = (7-1)^2 + 14^2 + (-16)*(3*(-16)+1)/2 with 7 prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Mixed sums of squares and triangular numbers, Acta Arith. 127(2007), 103-113.
- Zhi-Wei Sun, On universal sums of polygonal numbers, Sci. China Math. 58(2015), no. 7, 1367-1396.
Crossrefs
Programs
-
Mathematica
pQ[n_]:=pQ[n]=IntegerQ[Sqrt[24n+1]] Do[r=0;Do[If[(PrimeQ[x+1]||PrimeQ[y+1])&&pQ[n-x^2-y^2],r=r+1],{x,0,Sqrt[n/2]},{y,x,Sqrt[n-x^2]}];Print[n," ",r];Continue,{n,1,70}]
Comments