cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A106667 a(n) = 1 if prime(n) + 2 is a prime, a(n) = -1 if prime(n) + 2 is a semiprime, otherwise 0.

Original entry on oeis.org

-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

Views

Author

Giovanni Teofilatto, May 13 2005

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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

Extensions

Corrected, and definition clarified, by Robert Israel, Aug 29 2018