A087032 a(n) = 1 if 2*A151800(n) - n is prime, otherwise 0, where A151800(n) is the smallest prime > n.
1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0
Offset: 1
Examples
a(1)=1 because the smallest prime > 1 is 2 and 2*2-1=3 is prime.
Links
Programs
-
Mathematica
bb={}; Do[bb={bb, If[PrimeQ[2(Prime[PrimePi[n]+1])-n], 1, 0]}, {n, 1000}]; Flatten[bb]
-
PARI
A087032(n) = isprime((2*nextprime(1+n))-n); \\ Antti Karttunen, Oct 09 2018
Formula
a(n) = 1 if A087030(n) is prime, 0 if it is composite.
Extensions
Definition edited by Antti Karttunen, Oct 09 2018
Comments