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-9 of 9 results.

A057622 Initial prime in first sequence of n consecutive primes congruent to 5 modulo 6.

Original entry on oeis.org

5, 23, 47, 251, 1889, 7793, 43451, 243161, 726893, 759821, 1820111, 1820111, 10141499, 19725473, 19725473, 136209239, 400414121, 400414121, 489144599, 489144599, 766319189, 766319189, 21549657539, 21549657539, 21549657539, 140432294381, 140432294381, 437339303279, 1871100711071, 3258583681877
Offset: 1

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

Same as A057621 except for a(1). See A057620 for primes congruent to 1 (mod 6). See A055626 for the variant "exactly n", which is an upper bound, cf. formula. - M. F. Hasler, Sep 03 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(12) = 1820111 because this number is the first in a sequence of 12 consecutive primes all of the form 6n + 5.
		

References

  • R. K. Guy, "Unsolved Problems in Number Theory", A4

Crossrefs

Programs

  • Mathematica
    p = 0; Do[a = Table[-1, {n}]; k = Max[1, p]; While[Union@ a != {5}, k = NextPrime@ k; a = Take[AppendTo[a, Mod[k, 6]], -n]]; p = NestList[NextPrime[#, -1] &, k, n]; Print[p[[-2]]]; p = p[[-1]], {n, 18}] (* Robert G. Wilson v, updated by Michael De Vlieger, Sep 03 2016 *)
    Table[k = 1; While[Total@ Boole@ Map[Mod[#, 6] == 5 &, NestList[NextPrime, Prime@ k, n - 1]] != n, k++]; Prime@ k, {n, 12}] (* Michael De Vlieger, Sep 03 2016 *)

Formula

a(n) = A000040(A247967(n)). a(n) = min { A055626(k); k >= n }. - M. F. Hasler, Sep 03 2016

Extensions

More terms from Don Reble, Nov 16 2003
More terms from Jens Kruse Andersen, May 30 2006
Three lines of data (derived from J.K.Andersen's web page) completed by M. F. Hasler, Sep 02 2016

A057624 Initial prime in first sequence of n primes congruent to 1 modulo 4.

Original entry on oeis.org

5, 13, 89, 389, 2593, 11593, 11593, 11593, 11593, 373649, 766261, 3358169, 12204889, 12270077, 12270077, 12270077, 297387757, 297779117, 297779117, 1113443017, 1113443017, 1113443017, 1113443017, 1113443017, 84676452781, 84676452781, 689101181569, 689101181569, 689101181569, 3278744415797, 3278744415797, 3278744415797, 3278744415797
Offset: 1

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(9) = 11593 because "[t]his number is the first in a sequence of 9 consecutive primes all of the form 4n + 1."
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A4.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Revised Edition, Penguin Books, London, England, 1997, page 163.

Crossrefs

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k = n + 1}, While[ ! PrimeQ[ k ], k++ ]; Return[ k ] ]; PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; Return[ k ] ]; p = 0; Do[ a = Table[ -1, {n} ]; k = Max[ 1, p ]; While[ Union[ a ] != {1}, k = NextPrime[ k ]; a = Take[ AppendTo[ a, Mod[ k, 4 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 19} ]

Extensions

More terms from Don Reble, Nov 16 2003
More terms from Jens Kruse Andersen, May 29 2006

A055625 First prime starting a chain of exactly n consecutive primes congruent to 1 modulo 6.

Original entry on oeis.org

7, 31, 151, 3049, 7351, 1741, 19471, 118801, 498259, 148531, 406951, 2513803, 2339041, 89089369, 51662593, 73451737, 232301497, 450988159, 1558562197, 2506152301, 1444257673, 28265029657, 24061965043, 87996684091, 43553959717
Offset: 1

Views

Author

Labos Elemer, Jun 05 2000

Keywords

Comments

The term "exactly" means that before the first and after the last primes of chain, the immediate primes are not congruent to 1 modulo 6.
See A057620 for the variant where "exactly" is replaced by "at least". - M. F. Hasler, Sep 03 2016

Crossrefs

Programs

  • Fortran
    c See link in A085515.
  • Mathematica
    pp = Table[{p = Prime[n], Mod[p, 6]}, {n, 10^6}];
    sp = Split[pp, Mod[#1[[2]], 6] == Mod[#2[[2]], 6]&];
    a[n_] := SelectFirst[sp, Length[#] == n && MatchQ[#, {{_Integer, 1} ..}]& ][[1, 1]];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 13}] (* Jean-François Alcover, Nov 21 2018 *)

Extensions

Corrected and extended by Reiner Martin, May 19 2001
More terms from Hugo Pfoertner, Jul 31 2003
a(20)>2^31, a(21)=1444257673. - Hugo Pfoertner, Jul 31 2003
More terms from Jens Kruse Andersen, May 30 2006
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 27 2006

A057619 Initial prime in first sequence of n primes congruent to 3 modulo 4.

Original entry on oeis.org

3, 7, 199, 199, 463, 463, 463, 36551, 39607, 183091, 241603, 241603, 241603, 9177431, 9177431, 95949311, 105639091, 341118307, 727334879, 727334879, 1786054147, 1786054147, 22964264027, 54870713243, 79263248027, 113391385603
Offset: 1

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(13) = 241603 because this number is the first in a sequence of 13 consecutive primes all of the form 4n + 3.
		

References

  • R. K. Guy, "Unsolved Problems in Number Theory", A4

Crossrefs

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k = n + 1}, While[ ! PrimeQ[ k ], k++ ]; Return[ k ] ]; PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; Return[ k ] ]; p = 0; Do[ a = Table[ -1, {n} ]; k = Max[ 1, p ]; While[ Union[ a ] != {3}, k = NextPrime[ k ]; a = Take[ AppendTo[ a, Mod[ k, 4 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 18} ]
    With[{prs=Table[If[Mod[Prime[n],4]==3,1,0],{n,4646*10^6}]},Prime/@ Table[ SequencePosition[prs,PadRight[{},k,1],1][[1,1]],{k,26}]] (* The program will take a long time to run and requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 28 2017 *)

Extensions

More terms from Don Reble, Nov 16 2003
More terms from Jens Kruse Andersen, May 29 2006

A054679 First of n consecutive primes which differ by a multiple of 6.

Original entry on oeis.org

2, 23, 47, 251, 1741, 1741, 19471, 118801, 148531, 148531, 406951, 1820111, 2339041, 19725473, 19725473, 73451737, 232301497, 400414121, 489144599, 489144599, 766319189, 766319189, 21549657539, 21549657539, 21549657539, 140432294381, 140432294381, 437339303279, 1552841185921, 1552841185921, 1552841185921
Offset: 1

Views

Author

Jeff Burch, Apr 18 2000

Keywords

Comments

See A276414 for the indices of these primes. - M. F. Hasler, Sep 02 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Crossrefs

Formula

a(n) = A000040(A276414(n)). - M. F. Hasler, Sep 02 2016
a(n) = min(A057620(n), A057621(n)) for all n >= 1. - M. F. Hasler, Sep 03 2016

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 09 2000
More terms from Jens Kruse Andersen, May 30 2006
Initial term and a(27)-a(31) added and name edited by M. F. Hasler, Sep 02 2016

A247816 a(n) is the smallest k such that prime(k+i) = 1 (mod 6) for i = 0, 1,...,n-1.

Original entry on oeis.org

4, 11, 36, 271, 271, 271, 2209, 11199, 13717, 13717, 34369, 172146, 172146, 3094795, 3094795, 4308948, 12762142, 23902561, 72084956, 72084956, 72084956, 1052779161, 1052779161, 1857276773, 1857276773, 19398320447, 57446769091, 57446769091, 57446769091
Offset: 1

Views

Author

Michel Lagneau, Sep 28 2014

Keywords

Comments

Equivalently, "mod 6" can be replaced by "mod 3". See A247967 for the variant "= 5 (mod 6)" and A276414 for runs of primes congruent to each other (mod 3). - M. F. Hasler, Sep 02 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(1)= 4 => prime(4) (mod 6)= 1;
a(2)= 11 => prime(11)(mod 6)= 1, prime(12)(mod 6) = 1;
a(3)= 36 => prime(36)(mod 6)= 1, prime(37)(mod 6)= 1, prime(38)(mod 6)= 1.
The resulting primes are:
7;
31, 37;
151, 157, 163;
1741, 1747, 1753, 1759;
1741, 1747, 1753, 1759, 1777;
1741, 1747, 1753, 1759, 1777, 1783;
19471, 19477, 19483, 19489, 19501, 19507, 19531;
... - _Michel Marcus_, Sep 29 2014
		

Crossrefs

Programs

  • Maple
    for n from 1 to 22 do :
    ii:=0:
       for k from 3 to 10^5 while (ii=0)do :
         s:=0:
          for i from 0 to n-1 do:
            r:=irem(ithprime(k+i),6):
            if r = 1
            then
            s:=s+1:
            else
            fi:
          od:
           if s=n and ii=0
           then
           printf ( "%d %d \n",n,k):ii:=1:
           else
           fi:
        od:
    od:
  • Mathematica
    With[{m6=If[Mod[#,6]==1,1,0]&/@Prime[Range[5*10^6]]},Flatten[Table[SequencePosition[ m6,PadRight[{},n,1],1],{n,16}],1]][[;;,1]] (* Harvey P. Dale, May 07 2023 *)
  • PARI
    m=c=i=0;forprime(p=1,, i++;p%6!=1&&(!c||!c=0)&&next; c++>m||next; print1(1+i-m=c,",")) \\ M. F. Hasler, Sep 02 2016

Formula

a(n) = primepi(A057620(n)). - Michel Marcus, Sep 30 2014

Extensions

a(12)-a(21) from A057620 by Michel Marcus, Oct 03 2014
a(22)-a(29) from Giovanni Resta, Oct 03 2018

A289119 Least prime beginning a string, of length at least n, of consecutive primes which alternate between types 6*k+1 and 6*k+5 or 6*k+5 and 6*k+1.

Original entry on oeis.org

5, 5, 5, 5, 5, 5, 5, 89, 89, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 809, 3954889, 15186319, 15186319, 15186319, 77011289, 77011289, 77011289, 288413159, 288413159, 288413159, 288413159, 288413159, 62585146739, 114058236679, 143014298809
Offset: 1

Views

Author

Jonathan Sondow, Jun 25 2017

Keywords

Comments

Conjecture: the sequence is infinite. (Motivation: the string HTHTHT... of length n eventually occurs in any sufficiently long sequence of coin tosses.)

Examples

			For k = 3, 4, ..., 33, {Prime[k], Mod[Prime[k], 6]} = {5, 5}, {7, 1}, {11, 5}, {13, 1}, {17, 5}, {19, 1}, {23, 5}, {29, 5}, {31, 1}, {37, 1}, {41, 5}, {43, 1}, {47, 5}, {53, 5}, {59, 5}, {61, 1}, {67,  1}, {71, 5}, {73, 1}, {79, 1}, {83, 5}, {89, 5}, {97, 1}, {101, 5}, {103, 1}, {107, 5}, {109, 1}, {113, 5}, {127, 1}, {131, 5}, {137, 5}, so a(n) = 5, 5, 5, 5, 5, 5, 5, 89, 89 for n = 1, 2, ..., 9 with a(10) > 89.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A4.

Crossrefs

Programs

  • Mathematica
    j = 3; T = Table[ While[ Product[ Mod[ Prime[k + 1] - Prime[k], 6], {k, j, j + n}] == 0, j++]; Prime[j], {n, 0, 20}]; Prepend[T, 5]

Extensions

a(23)-a(36) from Giovanni Resta, Jun 29 2017

A288915 Run lengths in A039704.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Jun 19 2017

Keywords

Comments

Is the sequence bounded?
On Dickson's conjecture this sequence is unbounded. Records: a(1) = 1, a(9) = 2, a(13) = 3, a(39) = 4, a(180) = 6, a(1348) = 7, a(6698) = 8, a(8156) = 10, a(20230) = 11, a(79011) = 12, a(99250) = 13, a(710895) = 15, a(2421600) = 16, a(7128444) = 17, a(11898707) = 18, a(14368535) = 20, a(21943755) = 22, a(519775979) = 25, a(3111006505) = 27. - Charles R Greathouse IV, Jun 19 2017

Crossrefs

Programs

  • Mathematica
    Length /@ Split[Mod[Prime[Range[100]], 6]]
  • PARI
    t=1;p=2;forprime(q=3,1e3,if((q-p)%6==0,t++,print1(t", ");t=1);p=q) \\ Charles R Greathouse IV, Jun 19 2017

Extensions

a(70) corrected by Charles R Greathouse IV, Jun 19 2017

A382249 a(n) is the smallest starting prime of a sequence of exactly n consecutive primes that are alternately of the form 6*k+1 and 6*k-1 or vice versa.

Original entry on oeis.org

23, 19, 17, 13, 11, 7, 5, 97, 89, 877, 863, 859, 857, 853, 839, 829, 827, 823, 821, 811, 809, 3954889, 15186331, 15186323, 15186319, 77011331, 77011303, 77011289, 288413249, 288413233, 288413219, 288413173, 288413159, 62585146739, 114058236679, 143014298851, 143014298831, 143014298809
Offset: 1

Views

Author

Jean-Marc Rebert, Mar 19 2025

Keywords

Examples

			a(1) = 23, because 23 and 29 are 2 consecutive primes such that 23 = 6*4 - 1, while 29 = 6*5 - 1. Additionally, no smaller prime possesses this property.
a(2) = 19, because 19, 23 and 29 are 3 consecutive primes such that 19 = 6*3 + 1 and 23 = 6*4 - 1, while 29 = 6*5 - 1. Additionally, no smaller prime possesses this property.
Table of consecutive primes
  1 [23] = 6*[4] + [-1];
  2 [19, 23] = 6*[3, 4] + [1, -1];
  3 [17, 19, 23] = 6*[3, 3, 4] + [-1, 1, -1];
  4 [13, 17, 19, 23] = 6*[2, 3, 3, 4] + [1, -1, 1, -1];
  5 [11, 13, 17, 19, 23] = 6*[2, 2, 3, 3, 4] + [-1, 1, -1, 1, -1];
		

Crossrefs

Showing 1-9 of 9 results.