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.

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.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 27 2016

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 49, 608.
(ii) Let T(x) = x*(x+1)/2 and pen(x) = x*(3x+1)/2. Any positive integer can be written as (p-1)^2+P(x,y) with p prime and x and y integral, where the polynomial P(x,y) is either of the following ones: T(x)+2*pen(y), 2*T(x)+pen(y), T(x)+y*(5y+1)/2, T(x)+y*(9y+5)/2, pen(x)+y*(5y+j)/2 (j = 1,3), pen(x)+y*(7y+k)/2 (k = 3,5), pen(x)+y*(4y+j) (j = 1,3), pen(x)+y*(5y+r) (r = 1,2,3,4), pen(x)+2y*(3y+i) (i = 1,2), pen(x)+6*pen(y), x*(5x+1)/2+y*(3y+2), x*(5x+1)/2+y*(9y+7)/2, x*(5x+3)/2+y*(3y+i) (i = 1,2), x*(5x+3)/2+y*(9y+5)/2.
See also A270928 for a similar conjecture involving T(p-1) = p*(p-1)/2 with p prime.

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.
		

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}]