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
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
a(13) = 241603 because this number is the first in a sequence of 13 consecutive primes all of the form 4n + 3.
- R. K. Guy, "Unsolved Problems in Number Theory", A4
-
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 *)
A162865
Initial prime of exactly nine consecutive primes congruent to 1 modulo 4.
Original entry on oeis.org
11593, 206953, 315257, 541097, 906541, 992393, 1124993, 1410361, 1595081, 1781569, 1872049, 2043329, 2090353, 2312749, 2381657, 2481509, 2497289, 2718389, 2758109, 2772409, 2976397, 3863473, 3868849, 4027957, 4042673, 4375141, 4464841, 4547581, 4606153
Offset: 1
-
m9Q[l_]:=Module[{ms=Mod[l,4]},First[ms]!=1&&Last[ms]!=1&&Union[Take[ ms,{2,10}]]=={1}]; Transpose[Select[Partition[ Prime[Range[ 290000]], 11,1],m9Q]][[2]] (* Harvey P. Dale, Oct 23 2011 *)
A057632
Initial prime in first sequence of n primes congruent to 3 modulo 8.
Original entry on oeis.org
3, 491, 2243, 42299, 274123, 4310083, 4310083, 9065867, 547580443, 1885434347, 8674616939, 11312238283, 19201563659, 619849118491, 4056100954547, 13721202685691, 119254168189363, 276151474703651, 2189798979924331, 3153425741761723
Offset: 1
a(3) = 2243 because this number is the first in a sequence of 3 consecutive primes all of the form 8*n + 3.
-
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, 8 ] ], -n ] ]; p = NestList[ PrevPrime, k, n ]; Print[ p[ [ -2 ] ] ]; p = p[ [ -1 ] ], {n, 1, 9} ]
A363016
a(n) is the least integer k such that the k-th, (k+1)-th, ..., (k+n-1)-th primes are congruent to 1 mod 4.
Original entry on oeis.org
3, 6, 24, 77, 378, 1395, 1395, 1395, 1395, 31798, 61457, 240748, 800583, 804584, 804584, 804584, 16118548, 16138563, 16138563, 56307979, 56307979, 56307979, 56307979, 56307979, 3511121443, 3511121443, 26284355567, 26284355567, 26284355567, 118027458557, 118027458557, 118027458557, 118027458557
Offset: 1
For n=3, a(3) = 24 because prime(24)+1=90, prime(25)+1=98, and prime(26)+1=102 are the first 3 consecutive primes p such that p+1 is divisible by 2 and not by 4.
A376396
Triangle read by rows: the n-th row gives the least sequence of n consecutive primes all of the form 4*m + 1.
Original entry on oeis.org
5, 13, 17, 89, 97, 101, 389, 397, 401, 409, 2593, 2609, 2617, 2621, 2633, 11593, 11597, 11617, 11621, 11633, 11657, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689
Offset: 1
The triangle begins as:
5;
13, 17;
89, 97, 101;
389, 397, 401, 409;
2593, 2609, 2617, 2621, 2633;
11593, 11597, 11617, 11621, 11633, 11657;
11593, 11597, 11617, 11621, 11633, 11657, 11677;
11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681;
11593, 11597, 11617, 11621, 11633, 11657, 11677, 11681, 11689;
373649, 373657, 373661, 373669, 373693, 373717, 373721, 373753, 373757, 373777;
...
- R. K. Guy, Unsolved Problems in Number Theory, 2nd. ed., Section A4.
- David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 11593 at. p. 173.
-
kold=1; row[n_]:=Module[{r={}}, k=kold; While[Mod[Prime[k],4]!=1, k++]; While[Product[Boole[Mod[Prime[k+i],4]==1], {i,0,n-1}]!=1, k++]; kold=k; Table[Prime[i+k], {i,0,n-1}]]; Array[row,9]//Flatten
Showing 1-7 of 7 results.
Comments