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 11 results. Next

A098058 Prime(n) such that 4 does not divide the difference between prime(n) and prime(n+1).

Original entry on oeis.org

2, 3, 5, 11, 17, 23, 29, 31, 41, 47, 53, 59, 61, 71, 73, 83, 101, 107, 113, 131, 137, 139, 149, 151, 157, 167, 173, 179, 181, 191, 197, 227, 233, 239, 241, 251, 257, 263, 269, 271, 281, 283, 293, 311, 317, 331, 337, 347, 353, 367, 373, 383, 409, 419, 421, 431
Offset: 1

Views

Author

Cino Hilliard, Sep 11 2004

Keywords

Comments

First differences are also not divisible by 4. - Zak Seidov, Jun 23 2015
Starting with 3, group the primes into runs of consecutive primes either all == 1 (mod 4) or all == 3 (mod 4). Only the last prime of each run appears in this sequence. Since the runs alternate == 1 (mod 4) and == 3 (mod 4), so do the members of this sequence. - Franklin T. Adams-Watters, Jun 23 2015
The sequence is infinite, by Dirichlet's theorem on primes in arithmetic progressions. The sequence contains arbitrarily long gaps, by Daniel Shiu's theorem on strings of congruent primes (see A057619 and A057622). Conjecture: The sequence contains arbitrarily long strings of consecutive primes (see A289118). - Jonathan Sondow, Jun 25 2017

Examples

			Prime(2) = 3, prime(3) = 5. 4 does not divide 5-3 so prime(2)=3 is in the sequence.
Runs: (3), (5), (7,11), (17), (19, 23), (29), (31), (37,41), (43,47), (53), ... The sequence is 2 followed by the last member of each run. Differences within each run are always divisible by 4.
		

References

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

Crossrefs

Programs

  • Mathematica
    Prime[Select[Range[100], Mod[Prime[ # + 1] - Prime[ # ], 4] !=0 &]] (* Ray Chandler, Oct 09 2006 *)
  • PARI
    f(n) = for(x=1,n,z=(prime(x+1)-prime(x));if(z%4,print1(prime(x)",")))
    
  • PARI
    alist(n)=my(r=vector(n),p=2,np,k=0);while(kFranklin T. Adams-Watters, Jun 23 2015
    
  • PARI
    list(lim)=my(v=List(),p=2); forprime(q=3,nextprime(lim\1+1), if((q-p)%4, listput(v,p)); p=q); Vec(v) \\ Charles R Greathouse IV, Jun 24 2015

Extensions

Edited by Ray Chandler, Oct 26 2006

A057620 Initial prime in first sequence of n consecutive primes congruent to 1 modulo 6.

Original entry on oeis.org

7, 31, 151, 1741, 1741, 1741, 19471, 118801, 148531, 148531, 406951, 2339041, 2339041, 51662593, 51662593, 73451737, 232301497, 450988159, 1444257673, 1444257673, 1444257673, 24061965043, 24061965043, 43553959717, 43553959717
Offset: 1

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

See A055626 for the variant "exactly n". See A247967 for the indices of these primes. See A057620, A057621 for variants "congruent to 5 (mod 6)", resp. "(mod 3)". - M. F. Hasler, Sep 03 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(6) = 1741 because this number is the first in a sequence of 6 consecutive primes all of the form 3n + 1.
		

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] != {1}, k = NextPrime[k]; a = Take[AppendTo[a, Mod[k, 3]], -n]]; p = NestList[NextPrime[#, -1] &, k, n]; Print[p[[-2]]]; p = p[[-1]], {n, 1, 18}] (* Robert G. Wilson v, updated by Michael De Vlieger, Sep 03 2016 *)
    Table[k = 1; While[Total@ Boole@ Map[Mod[#, 6] == 1 &, NestList[NextPrime, Prime@ k, n - 1]] != n, k++]; Prime@ k, {n, 12}] (* Michael De Vlieger, Sep 03 2016 *)
  • PARI
    m=c=o=0; forprime(p=1,, p%6 != 1 && (!c||!c=0) && next; c||o=p; c++>m||next; m++; print1(", ",o)) \\ M. F. Hasler, Sep 03 2016

Formula

a(n) <= A055625(n). - Zak Seidov, Aug 29 2016
a(n) = A000040(A247967(n)). a(n) = min { A055625(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
Definition clarified by Zak Seidov, Jun 19 2017

A247967 a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 5, 5, ... for i = 0, 1, ..., n-1.

Original entry on oeis.org

3, 9, 15, 54, 290, 987, 4530, 21481, 58554, 60967, 136456, 136456, 673393, 1254203, 1254203, 7709873, 21357253, 21357253, 25813464, 25813464, 39500857, 39500857, 947438659, 947438659, 947438659, 5703167678, 5703167678, 16976360924, 68745739764, 117327812949
Offset: 1

Views

Author

Michel Lagneau, Sep 28 2014

Keywords

Comments

Weakening the definition to prime(k+i) == 2 (mod 3) yields a(1) = 1, but all other terms are unchanged. See also A247816 (residue 5) or A276414 (equal residues, all 1 or all -1). - M. F. Hasler, Sep 02 2016

Examples

			a(1)= 3 => prime(3) == 5 (mod 6).
a(2)= 9 => prime(9) == 5 (mod 6), prime(10) == 5 (mod 6).
a(3)= 15 => prime(15) == 5 (mod 6), prime(16) == 5 (mod 6), prime(17) == 5 (mod 6).
From _Michel Marcus_, Sep 30 2014: (Start)
The resulting primes are:
  5;
  23, 29;
  47, 53, 59;
  251, 257, 263, 269;
  1889, 1901, 1907, 1913, 1931;
  7793, 7817, 7823, 7829, 7841, 7853;
  43451, 43457, 43481, 43487, 43499, 43517, 43541;
  243161, 243167, 243197, 243203, 243209, 243227, 243233, 243239;
  ... (End)
		

Crossrefs

Programs

  • MATLAB
    N = 2*10^8; % to use primes up to N
    P = mod(primes(N),6);
    P5 = find(P==5);
    n5 = numel(P5);
    a(1) = P5(1);
    for k = 2:100
      r = find(P5(k:n5) == P5(1:n5+1-k)+k-1,1,'first');
      if numel(r) == 0
         break
      end
      a(k) = P5(r);
    end
    a % Robert Israel, Sep 02 2016
  • 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 = 5
            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
    Table[k = 1; While[Times @@ Boole@ Map[Mod[Prime[k + #], 6] == 5 &, Range[0, n - 1]] == 0, k++]; k, {n, 10}] (* Michael De Vlieger, Sep 02 2016 *)
  • PARI
    a(n) = {k = 1; ok = 0; while (!ok, nb = 0; for (i=0, n-1, if (prime(k+i) % 6 == 5, nb++, break);); if (nb == n, ok=1, k++);); k;} \\ Michel Marcus, Sep 28 2014
    
  • PARI
    m=c=i=0;forprime(p=1,, i++;p%6!=5&&(!c||!c=0)&&next; c++>m||next; print1(1+i-m=c,",")) \\ M. F. Hasler, Sep 02 2016
    

Formula

a(n) = primepi(A057622(n)). - Michel Marcus, Oct 01 2014

Extensions

a(11)-a(22) from A057622 by Michel Marcus, Oct 03 2014
a(23)-a(25) from Jinyuan Wang, Jul 08 2019
a(26)-a(30) added using A057622 by Jinyuan Wang, Apr 15 2020

A055626 First prime starting a chain of exactly n consecutive primes congruent to 5 modulo 6.

Original entry on oeis.org

5, 23, 47, 251, 1889, 7793, 43451, 243161, 726893, 759821, 2280857, 1820111, 10141499, 40727657, 19725473, 136209239, 744771077, 400414121, 1057859471, 489144599, 13160911739, 766319189, 38451670931, 119618704427, 21549657539, 141116164769, 140432294381, 437339303279
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 5 modulo 6.
a(21)>2^31, a(22)= 766319189. - Hugo Pfoertner, Jul 31 2003
See A057622 for the variant where "exactly" is replaced by "at least". See A055625 for the variant "congruent to 1 (mod 6)". - M. F. Hasler, Sep 03 2016

Crossrefs

Programs

  • 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, 5} ..}]& ][[1, 1]];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 13}] (* Jean-François Alcover, Nov 21 2018 *)
  • PARI
    okchain(n, p) = {if ((precprime(p-1) % 6) == 5, return (0)); for (i=1, n, if ((p % 6) != 5, return (0)); p = nextprime(p+1);); if ((p % 6) == 5, 0, 1);}
    a(n) = {p = 5; while (! okchain(n, p), p = nextprime(p+1)); p;} \\ Michel Marcus, Dec 17 2013

Extensions

a(9)-a(13), including correction of a(9)-a(10) from Reiner Martin, Jul 18 2001
a(14)-a(20) from Hugo Pfoertner, Jul 31 2003
a(21)-a(25) from Jens Kruse Andersen, May 30 2006
a(26) and beyond from Giovanni Resta, Aug 04 2013

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

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

A057621 Initial prime in first sequence of n primes congruent to 2 modulo 3.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

Same as A057622 except for a(1). - Jens Kruse Andersen, May 30 2006

Examples

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

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 ] != {2}, k = NextPrime[ k ]; a = Take[ AppendTo[ a, Mod[ k, 3 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 18} ]

Formula

a(n) = A000040(A247967(n)) for all n > 1. - M. F. Hasler, Sep 03 2016

Extensions

More terms from Jens Kruse Andersen, May 30 2006

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

A284101 Initial primes of 14 consecutive primes all congruent to 5 mod 6.

Original entry on oeis.org

19725473, 19725479, 40727657, 40962983, 40962989, 44291297, 45404537, 45404543, 54470123, 54470147, 63846089, 63846119, 68208599, 68208611, 68364221, 90007661, 93602507, 99492971, 99492977, 99579647, 99579671, 117585977, 117585983
Offset: 1

Views

Author

Zak Seidov, Mar 20 2017

Keywords

Comments

Prime indices of a(n): 1254203,1254204,2475221,2488622,2488623,2677942,2741244,2741245.
a(1) = 19725473 = A057622(14). Actually 19725473, 40962983 and 45404537 are the initial primes of 15 such consecutive primes that is also a(1) = A057622(15).

Examples

			15 consecutive primes starting with 19725473 are
{19725473, 19725479, 19725527, 19725533, 19725599, 19725617, 19725623, 19725653, 19725659, 19725677, 19725683, 19725689, 19725701, 19725731, 19725737} with gaps
{6, 48, 6, 66, 18, 6, 30, 6, 18, 6, 6, 12, 30, 6} - all multiples of 6.
		

Crossrefs

Cf. A057622 Initial prime in first sequence of n consecutive primes all congruent to 5 mod 6.

Programs

  • Mathematica
    Select[Partition[Prime[Range[68*10^5]],14,1],AllTrue[Mod[#,6]==5&]][[;;,1]] (* Harvey P. Dale, Mar 06 2023 *)
    Prime[#]&/@(SequencePosition[If[Mod[#,6]==5,1,0]&/@Prime[Range[672*10^4]],PadRight[{},14,1]][[;;,1]]) (* Harvey P. Dale, Sep 22 2024 *)
  • PARI
    list(lim)=my(v=List(), P=primes(14), goal=vector(14,i,5), pm=P%6, idx=1); forprime(p=P[#P]+1,, P[idx]=p; pm[idx]=p%6; if(idx++>14,idx=1); if(P[idx]>lim, break); if(pm==goal, listput(v, P[idx]))); Vec(v) \\ Charles R Greathouse IV, Mar 20 2017

Extensions

a(9)-a(23) from Charles R Greathouse IV, Mar 20 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
Showing 1-10 of 11 results. Next