A213202 Number of ways to write n = p + sum_{k=1..m}(-1)^(m-k)*p_k, where p is a Sophie Germain prime and p_k is the k-th prime.
0, 0, 1, 2, 2, 3, 3, 2, 2, 3, 1, 2, 2, 2, 3, 2, 1, 3, 2, 1, 3, 1, 3, 5, 2, 2, 3, 2, 3, 4, 4, 4, 2, 3, 3, 3, 3, 2, 1, 2, 4, 5, 4, 4, 4, 2, 3, 3, 4, 4, 3, 2, 1, 4, 6, 6, 4, 4, 4, 4, 4, 4, 4, 2, 3, 3, 5, 6, 2, 2, 1, 4, 4, 5, 3, 3, 1, 2, 5, 4, 5, 5, 2, 4, 5, 7, 2, 5, 1, 5, 4, 4, 4, 6, 3, 2, 6, 4, 5, 4
Offset: 1
Keywords
Examples
a(11)=1 since 11=3+p_5-p_4+p_3-p_2+p_1 with 3 and 2*3+1 both prime. a(182)=1 since 182=179+(7-5+3-2) with 179 and 2*179+1 both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Conjectures involving primes and quadratic forms, arXiv:1211.1588.
- Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
Programs
-
Mathematica
sp[n_]:=qq[n]=PrimeQ[n]&&PrimeQ[2n+1] s[0_]:=0 s[n_]:=s[n]=Prime[n]-s[n-1] a[n_]:=a[n]=Sum[If[n-s[m]>0&&sp[n-s[m]],1,0],{m,1,n}] Do[Print[n," ",a[n]],{n,1,100}]
Comments