A216671 Let S_k = {x^2+k*y^2: x,y nonnegative integers}. How many out of S_1, S_2, S_3, S_7 does n belong to?
4, 2, 2, 4, 1, 1, 2, 3, 4, 1, 2, 2, 2, 0, 0, 4, 2, 2, 2, 1, 1, 1, 1, 1, 4, 1, 2, 2, 2, 0, 1, 3, 1, 2, 0, 4, 3, 1, 1, 1, 2, 0, 3, 2, 1, 0, 0, 2, 4, 2, 1, 2, 2, 1, 0, 1, 2, 1, 1, 0, 2, 0, 2, 4, 1, 1, 3, 2, 0, 0, 1, 3, 3, 1, 2, 2, 1, 0, 2, 1, 4, 2, 1, 1, 1, 1, 0, 2, 2, 1, 1, 1, 1, 0, 0, 1, 3, 2, 2, 4, 1, 1, 1, 1, 0, 1, 2, 2, 3, 0, 1, 2, 3, 1, 0, 2, 2, 1, 0, 0
Offset: 1
Keywords
References
- David A. Cox, Primes of the Form x^2 + n y^2, Wiley, 1989. - From N. J. A. Sloane, Sep 14 2012
Programs
-
PARI
for(n=1, 100, sol=0; for(x=0, 100, if(issquare(n-x*x)&&n-x*x>=0, sol++; break)); for(x=0, 100, if(issquare(n-2*x*x)&&n-2*x*x>=0, sol++; break)); for(x=0, 100, if(issquare(n-3*x*x)&&n-3*x*x>=0, sol++; break)); for(x=0, 100, if(issquare(n-7*x*x)&&n-7*x*x>=0, sol++; break)); print1(sol", ")) /* V. Raman, Oct 16 2012 */
Formula
The fraction of terms with a(n)>0 goes to zero as n increases. - Charles R Greathouse IV, Sep 11 2012
Extensions
Edited by N. J. A. Sloane, Sep 14 2012
Comments