login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A106667
a(n) = 1 if prime(n) + 2 is a prime, a(n) = -1 if prime(n) + 2 is a semiprime, otherwise 0.
1
-1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 0, -1, -1, 1, 0, -1, 1, 0, 0, -1, -1, 0, 1, 0, 1, -1, -1, -1, -1, 1, -1, 1, 0, -1, 0, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0, 1, 0, -1, 1, 0, -1, -1, -1, 1, 0, 0, 1, 0, -1, -1, 1, 0, -1, 0, -1, 1, 0, -1, -1, 0, 0, -1, 0, -1, 0, -1, -1, 1, 0, 1, 0, 0, -1, -1, 0, 1, 0, -1, -1, -1, -1
OFFSET
1,1
LINKS
EXAMPLE
a(1) = -1 because prime(1) = 2 and 2 + 2 = 4 is a semiprime;
a(2) = 1 because prime(2) = 3 and 3 + 2 = 5 is a prime;
a(14) = 0 because prime(14) = 43 and 43 + 2 = 45 is neither prime nor semiprime.
MAPLE
p:= 1:
for n from 1 to 100 do
p:= nextprime(p);
if isprime(p+2) then A[n]:=1
elif numtheory:-bigomega(p+2)=2 then A[n]:=-1
else A[n]:= 0
fi
od:
seq(A[n], n=1..100); # Robert Israel, Aug 29 2018
CROSSREFS
Sequence in context: A014503 A014230 A014451 * A133011 A296079 A354806
KEYWORD
easy,sign,less
AUTHOR
Giovanni Teofilatto, May 13 2005
EXTENSIONS
Corrected, and definition clarified, by Robert Israel, Aug 29 2018
STATUS
approved