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.

Showing 1-5 of 5 results.

A001097 Twin primes.

Original entry on oeis.org

3, 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, 641, 643
Offset: 1

Views

Author

N. J. A. Sloane, Mar 15 1996

Keywords

Comments

Union of A001359 and A006512.
The only twin primes that are Fibonacci numbers are 3, 5 and 13 [MacKinnon]. - Emeric Deutsch, Apr 24 2005
(p, p+2) are twin primes if and only if p + 2 can be represented as the sum of two primes. Brun (1919): Even if there are infinitely many twin primes, the series of all twin prime reciprocals does converges to [Brun's constant] (A065421). Clement (1949): For every n > 1, (n, n+2) are twin primes if and only if 4((n-1)! + 1) == -n (mod n(n+2)). - Stefan Steinerberger, Dec 04 2005
A164292(a(n)) = 1. - Reinhard Zumkeller, Mar 29 2010
The 100355-digit numbers 65516468355 * 2^333333 +- 1 are currently the largest known twin prime pair. They were discovered by Twin Prime Search and Primegrid in August 2009. - Paul Muljadi, Mar 07 2011
For every n > 2, the pair (n, n+2) is a twin prime if and only if ((n-1)!!)^4 == 1 (mod n*(n+2)). - Thomas Ordowski, Aug 15 2016
The term "twin primes" ("primzahlzwillinge", in German) was coined by the German mathematician Paul Gustav Samuel Stäckel (1862-1919) in 1916. Brun (1919) used the same term in French ("nombres premiers jumeaux"). Glaisher (1878) and Hardy and Littlewood (1923) used the term "prime-pairs". The term "twin primes" in English was used by Dantzig (1930). - Amiram Eldar, May 20 2023

References

  • Tobias Dantzig, Number: The Language of Science, Macmillan, 1930.
  • Paulo Ribenboim, The New Book of Prime Number Records, Springer-Verlag, 1996, pp. 259-265.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 132.

Crossrefs

Cf. A070076, A001359, A006512, A164292. See A077800 for another version.

Programs

  • Haskell
    a001097 n = a001097_list !! (n-1)
    a001097_list = filter ((== 1) . a164292) [1..]
    -- Reinhard Zumkeller, Feb 03 2014, Nov 27 2011
    
  • Maple
    A001097 := proc(n)
        option remember;
        if n = 1 then
            3;
        else
            for a from procname(n-1)+1 do
                if isprime(a) and ( isprime(a-2) or isprime(a+2) ) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Feb 19 2015
  • Mathematica
    Select[ Prime[ Range[120]], PrimeQ[ # - 2] || PrimeQ[ # + 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    Union[Flatten[Select[Partition[Prime[Range[200]],2,1],#[[2]]-#[[1]] == 2&]]] (* Harvey P. Dale, Aug 19 2015 *)
  • PARI
    isA001097(n) = (isprime(n) && (isprime(n+2) || isprime(n-2))) \\ Michael B. Porter, Oct 29 2009
    
  • PARI
    a(n)=if(n==1,return(3));my(p);forprime(q=3,default(primelimit), if(q-p==2 && (n-=2)<0, return(if(n==-1,q,p)));p=q) \\ Charles R Greathouse IV, Aug 22 2012
    
  • PARI
    list(lim)=my(v=List([3]),p=5); forprime(q=7,lim, if(q-p==2, listput(v,p); listput(v,q)); p=q); if(p+2>lim && isprime(p+2), listput(v,p)); Vec(v) \\ Charles R Greathouse IV, Mar 17 2017
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        yield 3
        p, q = 5, 7
        while True:
            if q - p == 2: yield from [p, q]
            p, q = q, nextprime(q)
    print(list(islice(agen(), 58))) # Michael S. Branicky, Apr 30 2022

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

A007508 Number of twin prime pairs below 10^n.

Original entry on oeis.org

2, 8, 35, 205, 1224, 8169, 58980, 440312, 3424506, 27412679, 224376048, 1870585220, 15834664872, 135780321665, 1177209242304, 10304195697298, 90948839353159, 808675888577436
Offset: 1

Views

Author

Keywords

Comments

"At the present time (2001), Thomas Nicely has reached pi_2(3*10^15) and his value is confirmed by Pascal Sebah who made a new computation from scratch and up to pi_2(5*10^15) [ = 5357875276068] with an independent implementation."
Though the first paper contributed by D. A. Goldston was reported to be flawed, the more recent one (with other coauthors) maintains and substantiates the result. - Lekraj Beedassy, Aug 19 2005
Theorem. While g is even, g > 0, number of primes p < x (x is an integer) such that p' = p + g is also prime, could be written as qpg(x) = qcc(x) - (x - pi(x) - pi(x + g) + 1) where qcc(x) is the number of "common composite numbers" c <= x such that c and c' = c + g both are composite (see Example below; I propose it here as a theorem only not to repeat for so-called "cousin"-primes (p; p+4), "sexy"-primes (p; p+6), etc.). - Sergey Pavlov, Apr 08 2021

Examples

			For x = 10, qcc(x) = 4 (since 2 is prime; 4, 6, 8, 10 are even, and no odd 0 < d < 25 such that both d and d' = d + 2 are composite), pi(10) = 4, pi(10 + 2) = 5, but, while v = 2+2 or v = 2-2 would be even, we must add 1; hence, a(1) = qcc(10^1) - (10^1 - pi(10^1) - pi(10^1 + 2) + 1) = 4 - (10 - 4 - 5 + 1) = 2 (trivial). - _Sergey Pavlov_, Apr 08 2021
		

References

  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 202.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 195.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001097.
Cf. A173081 and A181678 (number of twin Ramanujan prime pairs below 10^n).

Programs

  • Mathematica
    ile = 2; Do[Do[If[(PrimeQ[2 n - 1]) && (PrimeQ[2 n + 1]), ile = ile + 1], {n, 5*10^m, 5*10^(m + 1)}]; Print[{m, ile}], {m, 0, 7}] (* Artur Jasinski, Oct 24 2011 *)
  • PARI
    a(n)=my(s,p=2);forprime(q=3,10^n,if(q-p==2,s++);p=q);s \\ Charles R Greathouse IV, Mar 21 2013

Formula

Partial sums of A070076(n). - Lekraj Beedassy, Jun 11 2004
For 1 < n < 19, a(n) ~ e * pi(10^n) / (5*n - 5) = e * A006880(n) / (5*n - 5) where e is Napier's constant, see A001113 (probably, so is for any n > 18; we use n > 1 to avoid division by zero). - Sergey Pavlov, Apr 07 2021
For any n, a(n) = qcc(x) - (10^n - pi(10^n) - pi(10^n + 2) + 1) where qcc(x) is the number of "common composite numbers" c <= 10^n such that c and c' = c + 2 both are composite (trivial). - Sergey Pavlov, Apr 08 2021

Extensions

pi2(10^15) due to Nicely and Szymanski, contributed by Eric W. Weisstein
pi2(10^16) due to Pascal Sebah, contributed by Robert G. Wilson v, Aug 22 2002
Added a(17)-a(18) computed by Tomás Oliveira e Silva and link to his web site. - M. F. Hasler, Dec 18 2008
Definition corrected by Max Alekseyev, Oct 25 2010
a(16) corrected by Dana Jacobsen, Mar 28 2014

A099609 Naive list of twin primes (A077800 prefixed by 2, 3).

Original entry on oeis.org

2, 3, 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, 641
Offset: 1

Views

Author

N. J. A. Sloane, Nov 18 2004

Keywords

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. A070076, A077800. See A001097 for another version.

Programs

  • Mathematica
    Select[Partition[#, 2, 1] &@ Prime@ Range@ 120, First@ Differences@ # <= 2 &] // Flatten (* Michael De Vlieger, Mar 18 2017 *)

A120120 Number of n-digit prime quadruplets.

Original entry on oeis.org

1, 3, 7, 26, 128, 733, 3869, 23620, 152141, 1028789, 7188960, 51672312, 381226246, 2873279651
Offset: 2

Views

Author

Julien Peter Benney (jpbenney(AT)ftml.net), Aug 15 2006, Aug 19 2006

Keywords

Examples

			a(3) = 3 because there are three three-digit prime quadruples: {101, 103, 107, 109}, {191, 193, 197, 199} and {821, 823, 827, 829}.
		

Crossrefs

Extensions

a(6) corrected and a(15) supplied by Jon E. Schoenfield, Aug 27 2006
Showing 1-5 of 5 results.