A258139 Number of ways to write n as p^2 + q with p and q both prime.
0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 2, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 2, 2, 0, 1, 0, 2, 1, 0, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 2, 2, 0, 2, 0, 3, 1, 0, 0, 1, 0, 3, 1, 0, 1, 2, 0, 3, 0, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 1, 0, 2, 1, 1, 0, 1, 0, 3, 1, 0, 0, 2, 0, 2, 0, 0
Offset: 1
Keywords
Examples
a(11) = 2 since 11 = 2^2 + 7 = 3^2 + 2 with 2, 3, 7 all prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Do[r=0;Do[If[PrimeQ[n-Prime[k]^2],r=r+1],{k,1,PrimePi[Sqrt[n]]}];Print[n," ",r];Continue,{n,1,100}]
Formula
G.f.: (Sum_{k>=1} x^prime(k))*(Sum_{k>=1} x^(prime(k)^2)). - Ilya Gutkovskiy, Feb 05 2017
Comments