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.

A088019 Number of twin primes between n and 2n (inclusive).

This page as a plain text file.
%I A088019 #10 Feb 16 2025 08:32:51
%S A088019 0,1,2,2,2,2,3,2,3,4,4,3,3,2,3,4,4,3,3,2,3,4,4,4,4,4,4,4,4,4,5,4,4,4,
%T A088019 4,5,6,6,6,6,6,5,5,4,4,4,4,4,4,4,5,6,6,7,8,8,8,8,8,7,7,6,6,6,6,6,6,6,
%U A088019 7,8,8,7,7,6,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,10,10,10,10,10,11,12,12,13,14
%N A088019 Number of twin primes between n and 2n (inclusive).
%C A088019 Here a twin prime is counted even if only one member of the twin-prime pair is between n and 2n, inclusive. Note that this sequence is very close to 2*A088018. It appears that a(n) > 0 for all n > 1. However, it has not been proved that there are an infinite number of twin primes.
%H A088019 T. D. Noe, <a href="/A088019/b088019.txt">Table of n, a(n) for n=1..10000</a>
%H A088019 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TwinPrimes.html">Twin Primes</a>
%t A088019 pl=Prime[Range[PrimePi[20000]]]; twl={}; Do[If[pl[[i-1]]+2==pl[[i]], twl=Join[twl, {pl[[i-1]], pl[[i]]}]], {i, 2, Length[pl]}]; twl=Union[twl]; i1=1; i2=1; nMin=(twl[[1]]-1)/2; nMax=(twl[[ -1]]+1)/2; Join[Table[0, {nMin-1}], Table[While[twl[[i1]]<n, i1++ ]; While[i2<=Length[twl]&&twl[[i2]]<2n, i2++ ]; i2-i1, {n, nMin, nMax}]]
%Y A088019 Cf. A035250 (number of primes between n and 2n), A088018 (number of twin-prime pairs between n and 2n).
%K A088019 easy,nonn
%O A088019 1,3
%A A088019 _T. D. Noe_, Sep 18 2003