login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A168141 a(n) = pi(n + 1) - pi(n - 2), where pi is the prime counting function. 1
1, 2, 2, 2, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Conjecture: a(n) = 2 for infinitely many n. This is equivalent to the twin prime conjecture. - Andrew Slattery, Apr 26 2020

LINKS

Table of n, a(n) for n=1..105.

Eric Weisstein's World of Mathematics, Twin Prime Conjecture

Wikipedia, Twin prime

FORMULA

From Alois P. Heinz, Apr 28 2020: (Start)

a(n) = 2 <=> n in { 2,3 } union { A014574 }.

a(n) = 0 <=> { A079364 }. (End)

MAPLE

A168141 := proc(n) numtheory[pi](n+1)-numtheory[pi](n-2) ; end proc: seq(A168141(n), n=1..120) ; # R. J. Mathar, Nov 19 2009

# second Maple program:

a:= n-> add(`if`(isprime(n+i), 1, 0), i=-1..1):

seq(a(n), n=1..120);  # Alois P. Heinz, Apr 28 2020

MATHEMATICA

Table[PrimePi[n + 1] - PrimePi[n - 2], {n, 100}] (* Wesley Ivan Hurt, Apr 26 2020 *)

PROG

(PARI) a(n) = primepi(n+1) - primepi(n-2); \\ Michel Marcus, Apr 27 2020

CROSSREFS

Cf. A000720, A014574, A079364, A090406.

Sequence in context: A212119 A096831 A191516 * A232654 A034095 A105971

Adjacent sequences:  A168138 A168139 A168140 * A168142 A168143 A168144

KEYWORD

nonn

AUTHOR

Juri-Stepan Gerasimov, Nov 19 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 8 23:14 EST 2021. Contains 341959 sequences. (Running on oeis4.)