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.

A168141 a(n) = pi(n + 1) - pi(n - 2), where pi is the prime counting function.

This page as a plain text file.
%I A168141 #32 Jan 19 2025 11:04:14
%S A168141 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,
%T A168141 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,
%U A168141 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
%N A168141 a(n) = pi(n + 1) - pi(n - 2), where pi is the prime counting function.
%C A168141 Conjecture: a(n) = 2 for infinitely many n. This is equivalent to the twin prime conjecture. - _Andrew Slattery_, Apr 26 2020
%H A168141 Antti Karttunen, <a href="/A168141/b168141.txt">Table of n, a(n) for n = 1..20000</a>
%H A168141 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TwinPrimeConjecture.html">Twin Prime Conjecture</a>
%H A168141 Wikipedia, <a href="https://en.wikipedia.org/wiki/Twin_prime#Other_theorems_weaker_than_the_twin_prime_conjecture">Twin prime</a>
%F A168141 From _Alois P. Heinz_, Apr 28 2020: (Start)
%F A168141 a(n) = 2 <=> n in { 2,3 } union { A014574 }.
%F A168141 a(n) = 0 <=> n in A079364. (End)
%p A168141 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
%p A168141 # second Maple program:
%p A168141 a:= n-> add(`if`(isprime(n+i), 1, 0), i=-1..1):
%p A168141 seq(a(n), n=1..120);  # _Alois P. Heinz_, Apr 28 2020
%t A168141 Table[PrimePi[n + 1] - PrimePi[n - 2], {n, 100}] (* _Wesley Ivan Hurt_, Apr 26 2020 *)
%o A168141 (PARI) a(n) = primepi(n+1) - primepi(n-2); \\ _Michel Marcus_, Apr 27 2020
%Y A168141 Cf. A000720, A014574, A079364, A090406.
%K A168141 nonn
%O A168141 1,2
%A A168141 _Juri-Stepan Gerasimov_, Nov 19 2009