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-10 of 14 results. Next

A035789 Start of a string of exactly 1 consecutive (but disjoint) pair of twin primes.

Original entry on oeis.org

29, 41, 59, 71, 227, 239, 269, 281, 311, 347, 461, 521, 569, 599, 617, 641, 659, 857, 881, 1091, 1151, 1229, 1277, 1289, 1301, 1319, 1427, 1451, 1607, 1619, 1667, 1697, 1721, 1787, 1997, 2027, 2141, 2237, 2267, 2309, 2339, 2381, 2549, 2591, 2657, 2687
Offset: 1

Views

Author

Randall L Rathbun, Nov 30 1998

Keywords

Comments

Lesser of lonely twin primes.
Old Name was: Let P1,P2,..,P6 be any 6 consecutive primes. The sequence consists of those values of P3 for which P2-P1>2, P4-P3=2 and P6-P5>2.

Examples

			The first lonely twin primes (A069453) are 29,31 (23 and 37 are non-twin), 41,43 (37 and 47 are non-twin), 59,61 (53 and 67 are non-twin). Of these, the lesser twins are 29,41,59, so this is how the sequence begins.
23, 27, 29, 31, 37, 41: 27-23>2, 31-29=2, 41-37>2; so 29 is in the sequence.
From _Hartmut F. W. Hoft_, Apr 05 2016: (Start)
The example should read: 19, 23, 29, 31, 37, 41: 23-19>2, 31-29=2, 41-37>2; so 29 is in the sequence.
a(n)=A069453(2n-1), n>=1.
(End)
		

Crossrefs

Programs

  • Mathematica
    PrimeNext[n_]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k]; PrimePrev[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k]; lst={};Do[p=Prime[n];If[ !PrimeQ[p-2]&&!PrimeQ[p+4]&&PrimeQ[p+2]&&!PrimeQ[PrimePrev[p]-2]&&!PrimeQ[PrimeNext[p+2]+2],AppendTo[lst,p]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 22 2009 *)
    (* starting at n=3 would eliminate the first two primality tests, Hartmut F. W. Hoft, Apr 09 2016 *)

Extensions

Edited by Hugo Pfoertner, Oct 15 2003

A035790 Start of a string of exactly 2 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

101, 137, 419, 1019, 1049, 1481, 1871, 1931, 2081, 2111, 2969, 3251, 3461, 4259, 5009, 5651, 5867, 6689, 6947, 7331, 7547, 8219, 8969, 10007, 11057, 11159, 11699, 12239, 13001, 13709, 13997, 14561, 15641, 15731, 16061, 16631, 17579, 17909
Offset: 1

Views

Author

Randall L Rathbun, Nov 30 1998

Keywords

Comments

Let P1,P2,..,P8 be any 8 consecutive primes. The sequence consists of those values of P3 for which P2-P1 > 2, P4-P3 = 2, P6-P5= 2 and P8-P7 > 2.

Examples

			89, 97, 101, 103, 107, 109, 113, 127: 97-89 > 2, 103-101 = 2, 109-107 = 2, 127-113 > 2.
		

References

  • Posting to Number Theory List (NMBRTHRY(AT)LISTSERV.NODAK.EDU), Nov. 19 1998.

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 2100, And[NextPrime[#, -1] - NextPrime[#, -2] > 2, NextPrime@ # - # == 2, NextPrime[#, 3] - NextPrime[#, 2] == 2, NextPrime[#, 5] - NextPrime[#, 4] > 2] &] (* Michael De Vlieger, Apr 25 2015 *)
  • PARI
    a(n)={L=vector(7);forprime(p=o=1,,L=concat(L[2..7],-o+o=p); L[3]==2&&L[5]==2&&L[1]>2&&L[2]>2&&L[4]>2&&L[6]>2&&L[7]>2&&!n--&&return(p-sum(i=3,7,L[i])))} \\ M. F. Hasler, May 04 2015

Formula

a(10)=2111, a(10^2)=77261, a(10^3)=1603697, a(10^4)=27397631, a(10^5)=435140477, a(10^6)=6391490657. - M. F. Hasler, May 04 2015

Extensions

Edited by Hugo Pfoertner, Oct 15 2003
Offset corrected by Arkadiusz Wesolowski, May 06 2012
Double-checked up to a(10^4)=27397631 by M. F. Hasler, May 04 2015

A035791 Start of a string of exactly 3 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

5, 179, 809, 3359, 4217, 6761, 18041, 21587, 26861, 49367, 67187, 80447, 82721, 91127, 97841, 98897, 103967, 109829, 122597, 154157, 178037, 203321, 208931, 225749, 227609, 236867, 243671, 251201, 266447, 285611, 289109, 295871, 317729
Offset: 1

Views

Author

Keywords

Examples

			a(2)=179 because (179,181),(191,193),(197,199) is the second occurrence (after (5,7),(11,13),(17,19)) of exactly 3 pairs of twin primes.
		

References

  • Posting to Number Theory List (NMBRTHRY(AT)LISTSERV.NODAK.EDU), Nov. 19 1998.

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 30000, And[ NextPrime[#, -1] - NextPrime[#, -2] != 2, NextPrime@ # - # == 2, NextPrime[#, 3] - NextPrime[#, 2] == 2, NextPrime[#, 5] - NextPrime[#, 4] == 2, NextPrime[#, 7] - NextPrime[#, 6] > 2] &] (* Michael De Vlieger, Apr 25 2015 *)
    Select[Partition[Prime[Range[30000]],10,1],#[[8]]-#[[7]]==#[[6]]-#[[5]] == #[[4]] - #[[3]]==2&&#[[2]]-#[[1]]!=2&&#[[10]]-#[[9]]!=2&][[All,3]] (* Harvey P. Dale, Mar 14 2018 *)

Extensions

More terms from Hugo Pfoertner, Sep 05 2003
Offset corrected by Arkadiusz Wesolowski, May 06 2012

A035792 Start of a string of exactly 4 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

9419, 62969, 72221, 392261, 495569, 663569, 1006301, 1138367, 1159187, 1173539, 1322147, 2144477, 2168651, 2502341, 2668217, 3020999, 3215711, 3664679, 4890857, 5248079, 5261699, 5532269, 5561597, 5651729, 5787317, 6256727
Offset: 1

Views

Author

Keywords

References

  • Posting to Number Theory List (NMBRTHRY(AT)LISTSERV.NODAK.EDU), Nov. 19 1998.

Crossrefs

The first term of this sequence is in A087641.

Programs

  • Mathematica
    Prime[Select[Range[1000000], Prime[ # + 1] - Prime[ # ] == 2 && Prime[ # + 3] - Prime[ # + 2] == 2 && Prime[ # + 5] - Prime[ # + 4] == 2 && Prime[ # + 7] - Prime[ # + 6] == 2 &]] (* Tanya Khovanova, Sep 07 2007 *)

Extensions

a(11)-a(26) from Hugo Pfoertner, Sep 16 2003

A035795 Start of a string of exactly 7 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

678771479, 17479880399, 17830729991, 23799917819, 70455134039, 79453842029, 108108566471, 150411604619, 163868216387, 256385651969, 444790621787, 446688503687, 496081268777, 502910801927, 688735396829, 711503536589, 712407842477, 793957831409, 808316366171, 881191407827, 891108993767, 896804723201
Offset: 1

Views

Author

Keywords

Crossrefs

The first term of this sequence is in A087641.

Extensions

More terms from Jud McCranie, Sep 16 2003
Offset corrected by Arkadiusz Wesolowski, May 06 2012
a(17) from Natalia Makarova, Oct 06 2015
a(18)-a(22) from Vasily Danilov, Oct 08 2015

A035793 Start of a string of exactly 5 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

909287, 2596619, 9617981, 12628337, 18873497, 21579629, 25739771, 34140077, 39433367, 62832101, 67369397, 84733211, 90122507, 102243017, 132826607, 140456711, 142749149, 180929687, 201057539, 212461979, 219970547, 228001649
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    lst={};Do[p0=Prime[n];p1=Prime[n+1];p2=Prime[n+2];p3=Prime[n+3];p4=Prime[n+4];p5=Prime[n+5];p6=Prime[n+6];p7=Prime[n+7];p8=Prime[n+8];p9=Prime[n+9];If[p1-p0==p3-p2==p5-p4==p7-p6==p9-p8==2,AppendTo[lst,p0]],{n,10!}];lst (* Vladimir Joseph Stephan Orlovsky, Apr 02 2010 *)

Extensions

a(11)-a(22) from Hugo Pfoertner, Sep 16 2003
Offset corrected by Arkadiusz Wesolowski, May 06 2012

A035794 Start of a string of exactly 6 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

325267931, 412984667, 2227604747, 2409360557, 4014288869, 4363839617, 6988064579, 8402566787, 9497780417, 10099096127, 12347083739, 12429980741, 13022601257, 14198015129, 14845029299, 15330685079, 16810761029, 17049454841, 18266059421, 18864084791
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{k = 6}, And[NextPrime[n, -1] - NextPrime[n, -2] != 2, NextPrime[n, 2 k + 1] - NextPrime[n, 2 k] != 2, AllTrue[NextPrime[n, # + 1] - NextPrime[n, #] & /@ (Range[0, 2 k - 1, 2]), # == 2 &]]]; Select[Prime@ Range[10^9], fQ] (* Michael De Vlieger, May 09 2015, Version 10 *)
  • PARI
    isok(p) = {if (! isprime(p-2) && isprime(p+2), for (k=2, 6, my(q = nextprime(p+3)); if (! isprime(q+2), return (0)); p = q+2;); q = nextprime(p+3); if (isprime(q+2), return (0)); return (1);); return (0);} \\ Michel Marcus, Dec 06 2019

Extensions

a(11)-a(17) from Jud McCranie, Sep 16 2003
Offset corrected by Arkadiusz Wesolowski, May 06 2012
Wrong term 678771479 deleted and a(18)-a(26) from Sebastian Petzelberger, May 04 2015

A348168 Segment the list of prime numbers into sublists L_1, L_2, ... with L_1 = {2} and L_n = {p_1, p_2, ..., p_a(n)}, where a(n) is the largest m such that for 0 < i < m, p_1 - prevprime(p_1) > p_2 - p_1 >= p_{i+1} - p_i.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 2, 4, 1, 2, 3, 2, 1, 6, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 4, 2, 8, 1, 4, 2, 2, 1, 1, 5, 2, 1, 2, 2, 2, 1, 4, 6, 2, 2, 5, 8, 7, 2, 1, 1, 2, 10, 2, 2, 2, 2, 1, 4, 4, 2, 1, 5, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 4, 1, 1, 3, 2, 2, 3, 1, 2, 1, 2, 1, 2
Offset: 1

Views

Author

Ya-Ping Lu, Oct 03 2021

Keywords

Comments

The gap between two consecutive primes in L_n is smaller than g_{n-1} and g_n, where g_n is the gap between L_n and L_{n+1}. Sublists of length 2 are the most frequent ones and any pair of twin primes >= 11 stay in the same sublist.
Conjecture 1: lim_{n->oo} N_i/n = k_i, where N_i is the number of the first n sublists consisting of i primes and k_i is a constant, with k_2 > k_1 > k_3 > k_4 > ... .
Conjecture 2: lim_{n->oo} (Sum_{i=1..n} a(i))/n = Sum_{i=1..oo} i*k_i = e, meaning that, as n tends to infinity, the average length of sublists approaches 2.71828... (see the partial average - n plot in the links).
From Ya-Ping Lu, Apr 15 2024: (Start)
The distribution of sublists with 1, 2, 3, 4 and 5 primes and the number of primes in the first n sublists are given in the table below. k_i's as defined in Conjecture 1 are: k1 = 0.281, k2 = 0.431, k3 = 0.127, k4 = 0.058, and k5 = 0.031, approximately. Sublists with length <= 5 account for about 93% of the terms and 70% of the primes, as n approaches infinity.
n N_1 N_2 N_3 N_4 N_5 # of primes
---------- --------- --------- --------- -------- -------- -----------
1 1 0 0 0 0 1
10 6 3 0 1 0 16
100 33 44 5 9 3 232
1000 277 431 120 72 36 2617
10000 2821 4225 1243 642 331 27214
100000 28072 42929 12427 6059 3159 276081
1000000 279751 430299 126008 59729 32043 2747392
10000000 2804959 4303512 1264532 592726 317127 27426366
100000000 28070302 43078975 12686566 5869443 3143266 273972452
1000000000 280903920 431182582 127100032 58293618 31258182 2737643048
(End)

Examples

			See also the table of the sublists in the examples for A362017.
a(1) = 1 because L_1 = {2} by definition.
In the following examples we use p_0 to denote prevprime(p_1).
a(2) = 1. For the 2nd sublist, p_1 - p_0 = 3 - 2 = 1. If the next prime, 5, is in L_2, then p_2 - p_1 = 2 > p_1 - p_0. Therefore, 5 does not belong to L_2 and L_2 = {3}.
a(5) = 2. For the 5th sublist, p_1 - p_0 = 11 - 7 = 4. p_2 = 13 is in L_5 because p_2 - p_1 = 2 < p_1 - p_0. However, the next prime, 17, is not in L_5 as 17 - 13 > p_2 - p_1. Thus, L_5 = {11, 13}.
a(15) = 6. L_15 = {97, 101, 103, 107, 109, 113}, because p_1 - p_0 = 97-89 > p_2 - p_1 = 101-97 = 4, which is the maximum prime gap in L_15. 127, the prime after 113, is not in L_15 as 127-113 = 14 > p_2 - p_1.
		

Crossrefs

Cf. A362017 (first in each sublist), A087641, A226657, A001359, A023200.

Programs

  • Python
    from sympy import nextprime
    L = [2]
    for n in range(1, 100):
        print(len(L), end =', ')
        p0 = L[-1]; p1 = nextprime(p0); M = [p1]; g0 = p1 - p0; p = nextprime(p1); g1 = p - p1
        while g1 < g0 and p - p1 <= g1: M.append(p); p1 = p; p = nextprime(p)
        L = M

Extensions

Edited by Peter Munn, Jul 08 2025

A179067 Orders of consecutive clusters of twin primes.

Original entry on oeis.org

1, 3, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Franz Vrabec, Jun 27 2010

Keywords

Comments

For k>=1, 2k+4 consecutive primes P1, P2, ..., P2k+4 defining a cluster of twin primes of order k iff P2-P1 <> 2, P4-P3 = P6-P5 = ... = P2k+2 - P2k+1 = 2, P2k+4 - P2k+3 <> 2.
Also the lengths of maximal runs of terms differing by 2 in A029707 (leading index of twin primes), complement A049579. - Gus Wiseman, Dec 05 2024

Examples

			The twin prime cluster ((101,103),(107,109)) of order k=2 stems from the 2k+4 = 8 consecutive primes (89, 97, 101, 103, 107, 109, 113, 127) because 97-89 <> 2, 103-101 = 109-107 = 2, 127-113 <> 2.
From _Gus Wiseman_, Dec 05 2024: (Start)
The leading indices of twin primes are:
  2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, ...
with maximal runs of terms differing by 2:
  {2}, {3,5,7}, {10}, {13}, {17}, {20}, {26,28}, {33,35}, {41,43,45}, {49}, {52}, ...
with lengths a(n).
(End)
		

Crossrefs

Cf. A077800.
A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
A006512 gives the greater of twin primes.
A029707 gives the leading index of twin primes, complement A049579.
A038664 finds the first prime gap of length 2n.
A046933 counts composite numbers between primes.

Programs

  • Maple
    R:= 1: count:= 1: m:= 0:
    q:= 5: state:= 1:
    while count < 100 do
     p:= nextprime(q);
     if state = 1 then
        if p-q = 2 then state:= 2; m:= m+1;
        else
          if m > 0 then R:= R,m; count:= count+1; fi;
          m:= 0
        fi
     else state:= 1;
     fi;
     q:= p
    od:
    R; # Robert Israel, Feb 07 2023
  • Mathematica
    Length/@Split[Select[Range[2,100],Prime[#+1]-Prime[#]==2&],#2==#1+2&] (* Gus Wiseman, Dec 05 2024 *)
  • PARI
    a(n)={my(o,P,L=vector(3));n++;forprime(p=o=3,,L=concat(L[2..3],-o+o=p);L[3]==2||next;L[1]==2&&(P=concat(P,p))&&next;n--||return(#P);P=[p])} \\ M. F. Hasler, May 04 2015

Extensions

More terms from M. F. Hasler, May 04 2015

A263205 Start of a string of exactly 8 consecutive (but disjoint) pairs of twin primes.

Original entry on oeis.org

1107819732821, 3735283249697, 4588646146631, 6340698579419, 8412649748537, 9206359843907, 9667145661911, 10261787848841, 10877306469737, 13792968231041, 17231043159311, 18996369140627, 21471510972419, 21791129807147, 23105869316669, 23224938371519
Offset: 1

Views

Author

Dmitry Petukhov, Oct 12 2015

Keywords

Examples

			Starting from 1107819732769 = A151799(A151799(1107819732821)), the gaps between the next primes are (40, 12, 2, 88, 2, 4, 2, 28, 2, 10, 2, 16, 2, 58, 2, 22, 2, 24, 16) with 8 occurrences of 2, so 1107819732821 is a term. - _Michel Marcus_, Oct 16 2015
		

Crossrefs

Showing 1-10 of 14 results. Next