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
a(12) = 1820111 because this number is the first in a sequence of 12 consecutive primes all of the form 6n + 5.
- R. K. Guy, "Unsolved Problems in Number Theory", A4
-
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 *)
Three lines of data (derived from J.K.Andersen's web page) completed by
M. F. Hasler, Sep 02 2016
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
a(6) = 1741 because this number is the first in a sequence of 6 consecutive primes all of the form 3n + 1.
- R. K. Guy, "Unsolved Problems in Number Theory", A4
-
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 *)
-
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
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
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
-
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:
-
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 *)
-
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
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
a(12) = 1820111 because this number is the first in a sequence of 12 consecutive primes all of the form 3*n + 2.
-
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} ]
A276414
Index of the first prime which starts a run of n consecutive primes all congruent to each other mod 3 (or mod 6).
Original entry on oeis.org
1, 9, 15, 54, 271, 271, 2209, 11199, 13717, 13717, 34369, 136456, 172146, 1254203, 1254203, 4308948, 12762142, 21357253, 25813464, 25813464, 39500857, 39500857, 947438659, 947438659, 947438659, 5703167678, 5703167678, 16976360924, 57446769091, 57446769091, 57446769091
Offset: 1
prime(9) = 23 starts the first run of 2 consecutive primes, {23, 29}, which are congruent to each other (mod 6). Therefore a(2) = 9.
prime(15) = 47 starts the first run of 3 consecutive primes, {47, 53, 59}, which are congruent to each other (mod 6). Therefore a(3) = 15.
prime(54) = 251 starts the first run of 4 consecutive primes, {251, 257, 263, 269}, which are congruent to each other (mod 6). Therefore a(4) = 54.
prime(271) = 1741 starts the first run of 5 consecutive primes, {1741, 1747, 1753, 1759, 1777}, which are congruent to each other (mod 6). Therefore a(5) = 271. This is the first case where the primes are of the form 3k+1.
prime(271) = 1741 also starts the first run of 6 consecutive primes, {1741, 1747, 1753, 1759, 1777, 1783}, which are all congruent to each other (mod 6). Therefore a(6) = 271, too.
Subsequence of
A270190 (after discarding 1 and duplicates of other terms).
-
m=c=i=o=0;print1(1);forprime(p=1,,i++;(o-o=p)%3&&(!c||!c=0)&&next;c++>m||next;print1(",",i-m=c))
a(30)-a(31) from and name clarified by
Jinyuan Wang, Feb 24 2020
A247969
a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 1,5,1,5,... for i = 0, 1,...,n-1 ending with 1 or 5.
Original entry on oeis.org
4, 4, 4, 4, 4, 4, 25, 25, 59, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 280230, 280230, 981960, 981960, 981960, 4505195, 4505195, 7438440, 15658002, 15658002, 15658002, 15658002, 2628111621, 4671618380, 4671618380, 5803722576, 5803722576, 5803722576
Offset: 1
a(1)= 4 => prime(4) (mod 6)= 1, and not for k = 1, 2, 3.
a(2)= 4 => prime(4) (mod 6)= 1, prime(5) (mod 6) = 5;
a(3)= 4 => prime(4) (mod 6)= 1, prime(5) (mod 6)= 5, prime(6) (mod 6)= 1.
The corresponding primes are for
n= 6: 7, 11, 13, 17, 19, 23;
n= 8: 97, 101, 103, 107, 109, 113, 127, 131;
n= 9: 277, 281, 283, 293, 307, 311, 313, 317, 331;
n= 20: 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941. - _Michel Marcus_, Sep 29 2014
-
for n from 1 to 21 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 = irem(5^i,6)
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:
-
a(n) = {k = 1; ok = 0; while (! ok, m = 1; nb = 0; for (i=0, n-1, if ((prime(k+i) % 6) == m, nb++, break); m = 5*m % 6;); if (nb == n, ok = 1, k++);); k;} \\ Michel Marcus, Sep 29 2014
-
See Links section.
A247970
a(n) is the smallest k such that prime(k+i) (mod 6) takes successively the values 5,1,5,1... for i = 0, 1,...,n-1 ending with 1 or 5.
Original entry on oeis.org
3, 3, 3, 3, 3, 3, 3, 24, 24, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140
Offset: 1
a(1)= 3 => prime(3) (mod 6)= 5;
a(2)= 3 => prime(3) (mod 6)= 5, prime(4) (mod 6) = 1;
a(3)= 3 => prime(3) (mod 6)= 5, prime(4) (mod 6)= 1, prime(5) (mod 6)= 5.
-
with(numtheory):
for n from 1 to 35 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 = irem(5^(i+1),6)
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:
Showing 1-7 of 7 results.
Comments