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.

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