login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A090405 a(n) = PrimePi(n+2) - PrimePi(n). 3
2, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
For n>1, a(n) = 1 if n+1 or n+2 is prime, otherwise a(n) = 0. - Robert Israel, Mar 30 2017
LINKS
Eric Weisstein's World of Mathematics, Hardy-Littlewood Conjectures
MAPLE
with(numtheory): A090405:=n->pi(n+2)-pi(n): seq(A090405(n), n=1..150); # Wesley Ivan Hurt, Mar 30 2017
MATHEMATICA
Table[Subtract @@ Map[PrimePi, n + {2, 0}], {n, 120}] (* or *)
Table[Boole@ PrimeQ[n + 1 + Boole[OddQ@ n]] + Boole[n == 1], {n, 120}] (* Michael De Vlieger, Mar 30 2017 *)
PROG
(PARI) for(n=1, 100, print1(primepi(n + 2) - primepi(n), ", ")) \\ Indranil Ghosh, Mar 31 2017
(Python)
from sympy import primepi
print([primepi(n + 2) - primepi(n) for n in range(1, 101)])
# Indranil Ghosh, Mar 31 2017
(Python)
from sympy import isprime
def a(n):
if n<2: return 2
else:
if isprime(n + 1 + (n%2 == 1) + (n==1)): return 1
else: return 0 # Indranil Ghosh, Mar 31 2017
CROSSREFS
Sequence in context: A056978 A321761 A037819 * A237837 A365126 A168509
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Nov 29 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 12:14 EDT 2024. Contains 371792 sequences. (Running on oeis4.)