A006512 Greater of twin primes.
5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1429, 1453, 1483, 1489, 1609
Offset: 1
References
- See A001359 for further references and links.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Harvey Dubner, Twin Prime Statistics, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.2.
- R. K. Guy, Letter to N. J. A. Sloane, Jun 1991
- Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
- Omar E. Pol, Determinacion geometrica de los numeros primos y perfectos.
- Mario Raso, Integer Sequences in Cryptography: A New Generalized Family and its Application, Ph. D. Thesis, Sapienza University of Rome (Italy 2025). See p. 114.
- Wikipedia, Twin prime.
- Index entries for primes, gaps between
Crossrefs
Programs
-
Haskell
a006512 = (+ 2) . a001359 -- Reinhard Zumkeller, Feb 10 2015
-
Magma
[n: n in PrimesUpTo(1610)|IsPrime(n-2)]; // Bruno Berselli, Feb 28 2011
-
Maple
for i from 1 to 253 do if ithprime(i+1) = ithprime(i) + 2 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007 P := select(isprime,[$1..1609]): select(p->member(p-2,P),P); # Peter Luschny, Mar 03 2011 A006512 := proc(n) 2+A001359(n) ; end proc: # R. J. Mathar, Nov 26 2014
-
Mathematica
Select[Prime[Range[254]], PrimeQ[# - 2] &] (* Robert G. Wilson v, Jun 09 2005 *) Transpose[Select[Partition[Prime[Range[300]], 2, 1], Last[#] - First[#] == 2 &]][[2]] (* Harvey P. Dale, Nov 02 2011 *) Cases[Prime[Range[500]] + 2, ?PrimeQ] (* _Fred Patrick Doty, Aug 23 2017 *)
-
PARI
select(p->isprime(p-2),primes(1000))
-
PARI
a(n)=p=3; while(p+2 < (p=nextprime(p+1)) || n-->0, ); p vector(100, n, a(n)) \\ Altug Alkan, Dec 04 2015
-
Python
from sympy import primerange, isprime print([n for n in primerange(1, 2001) if isprime(n - 2)]) # Indranil Ghosh, Jul 20 2017
Comments