A092568 Duplicate of A055624.
3, 7, 739, 199, 883, 13127, 463, 36551, 39607, 183091, 4468903, 6419299, 241603
Offset: 1
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.
a(3)=89 because here n=3 and 89 is the start of a run of exactly 3 consecutive primes congruent to 1 mod 4. n=3: 83, 89, 97, 101, 103 are congruent to 3, 1, 1, 1, 3 modulo 4. So a(3) = 89. a(33) = 3278744415797. - _Jens Kruse Andersen_, May 29 2006
nn = 10; t = Table[0, {nn}]; found = 0; p = 1; cnt = 0; While[found < nn, p = NextPrime[p]; If[Mod[p, 4] == 1, cnt++, If[0 < cnt <= nn && t[[cnt]] == 0, t[[cnt]] = NextPrime[p, -cnt]; found++]; cnt = 0]]; t (* T. D. Noe, Jun 21 2013 *)
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 *)
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
a(9) = 11593 because "[t]his number is the first in a sequence of 9 consecutive primes all of the form 4n + 1."
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} ]
a(2)=11 because this is the 2nd prime in the first run of 2 primes where p == 3 mod 4.
Prime[#]&/@Flatten[Table[SequencePosition[If[Mod[#,4]==3,1,0]&/@Prime[ Range[ 615000]],PadRight[{},n,1],1],{n,15}],1][[All,2]] (* The program generates the first 15 terms of the sequence. *) (* Harvey P. Dale, Jun 17 2022 *)
r=0; c=0; forprime(p=2, 4e9, if(p%4==3, if(c++>r, r=c; print1(p", ")), c=0)) \\ Charles R Greathouse IV, Mar 22 2011
10 'cluster primes 20 C=1 30 input "end #";L 40 for N=3 to L step 2 50 S=int(sqrt(N)) 60 for A=3 to S step 2 70 B=N/A 80 if int(B)*A=N then cancel for:goto 170 90 next A 100 C=C+1 110 E=N/4:E=int(E):R=N-(4*E) 120 if R=1 then print N;:C1=C1+1:T1=T1+1:print T1 130 if R=3 then T1=0 140 if R=3 then print " ";N;:C3=C3+1:T2=T2+1:print T2 150 if R=1 then T2=0 160 if T1>10 or T2>10 then stop 170 next 180 print "Total primes=";C;:print "Type A";C1;"Type B";C3
c See link in A085515.
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 *)
m9Q[l_]:=Module[{ms=Mod[l,4]},First[ms]!=3&&Last[ms]!=3&&Union[ Take[ ms,{2,10}]]=={3}]; Transpose[Select[Partition[Prime[Range[ 320000]], 11,1],m9Q]][[2]] (* Harvey P. Dale, Oct 23 2011 *)
a(1) = 15 since 15 is a lucky number congruent to 3 mod 4, following 13 and followed by 21 which are both not congruent to 3 mod 4. a(2) = 3 since 3 and 7 are 2 consecutive lucky numbers congruent to 3 mod 4, following 1 and followed by 9 which are both not congruent to 3 mod 4.
a(1) = 1; a(2) = 1 + 1; a(3) = 1 + 1; a(4) = 1 + 1 + 1; a(5) = 1 + 1 + 3 + 2; a(6) = 1 + 1 + 5 + 4; a(7) = 1 + 1 + 7 + 6 + 1; a(8) = 1 + 1 + 9 + 8 + 6 + 3; a(9) = 1 + 1 + 11 + 10 + 15 + 10; a(10) = 1 + 1 + 13 + 12 + 28 + 21 + 1.
LinearRecurrence[{1, 0, 2, 0, 0, -1}, {1, 2, 2, 3, 7, 11}, 40] (* T. D. Noe, Jul 11 2013 *)
a(n) = if(n<=1, 1, sum(k=0, floor((n-1)/3), binomial(2*n-2-5*k,k)+binomial(2*n-1-5*k,k)) ); \\ Joerg Arndt, Jul 11 2013
Comments