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.

A077800 List of twin primes {p, p+2}.

Original entry on oeis.org

3, 5, 5, 7, 11, 13, 17, 19, 29, 31, 41, 43, 59, 61, 71, 73, 101, 103, 107, 109, 137, 139, 149, 151, 179, 181, 191, 193, 197, 199, 227, 229, 239, 241, 269, 271, 281, 283, 311, 313, 347, 349, 419, 421, 431, 433, 461, 463, 521, 523, 569, 571, 599, 601, 617, 619
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2002

Keywords

Comments

Union (with repetition) of A001359 and A006512.

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.

Crossrefs

Cf. A065421, A070076, A095958. See A001097 for another version.

Programs

  • Haskell
    a077800 n = a077800_list !! (n-1)
    a077800_list = concat $ zipWith (\p q -> if p == q+2 then [q,p] else [])
                                    (tail a000040_list) a000040_list
    -- Reinhard Zumkeller, Nov 27 2011
    
  • Mathematica
    Sort[ Join[ Select[ Prime[ Range[ 115]], PrimeQ[ # - 2] &], Select[ Prime[ Range[ 115]], PrimeQ[ # + 2] &]]] (* Robert G. Wilson v, Jun 09 2005 *)
    Select[ Partition[ Prime@ Range@ 115, 2, 1], #[[1]] + 2 == #[[2]] &] // Flatten
    Flatten[Select[{#, # + 2} & /@Prime[Range[1000]], PrimeQ[Last[#]]&]] (* Vincenzo Librandi, Nov 01 2012 *)
    Splice[{#,#+2}]& /@ Select[Prime[Range[PrimePi[619]]], PrimeQ[#+2]&] (* Oliver Seipel, Sep 04 2024 *)
  • PARI
    p=2;forprime(q=3,1e3,if(q-p==2,print1(p", "q", "));p=q) \\ Charles R Greathouse IV, Mar 22 2013

Formula

Sum_{n>=1} 1/a(n) is in the interval (1.840503, 2.288490) (Platt and Trudgian, 2020). The conjectured value based on assumptions about the distribution of twin primes is A065421. - Amiram Eldar, Oct 15 2020