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

A092567 Duplicate of A055623.

Original entry on oeis.org

5, 13, 89, 389, 2593, 12401, 77069, 262897, 11593, 373649, 766261, 3358169
Offset: 1

Views

Author

Keywords

A055624 First occurrence of run of primes congruent to 3 mod 4 of exactly length n.

Original entry on oeis.org

3, 7, 739, 199, 883, 13127, 463, 36551, 39607, 183091, 4468903, 6419299, 241603, 11739307, 9177431, 95949311, 105639091, 341118307, 1800380579, 727334879, 9449915743, 1786054147, 22964264027, 54870713243, 79263248027, 454648144571, 722204126767, 1749300591127, 5070807638111, 8858854801319, 6425403612031, 113391385603
Offset: 1

Views

Author

Labos Elemer, Jun 05 2000

Keywords

Comments

The term "exactly" means that before the first and after the last terms of chain, the immediate primes are not congruent to 3 modulo 4.
Carlos Rivera's Puzzle 256 includes Jack Brennen's a(24) starting at 1602195714419 to 1602195715423 and asks if anyone can break that 1999 record.

Examples

			a(3)=739 because here n=3 and 739 is the start of a run of exactly 3 consecutive primes congruent to 3 mod 4.
		

Crossrefs

Formula

Compute sequence of primes congruent to 3 mod 4. When first occurrence of run of exactly length n is found, add first prime to sequence.

Extensions

More terms from Reiner Martin, Jul 18 2001
More terms from Jens Kruse Andersen, May 29 2006
Edited by N. J. A. Sloane, Jun 01 2006

A145986 n-th prime in the first occurrence of at least n consecutive primes of the form 4k + 1.

Original entry on oeis.org

5, 17, 101, 409, 2633, 11657, 11677, 11681, 11689, 373777, 766373, 3358373, 12205121, 12270281, 12270301, 12270317, 297388097, 297779509, 297779513, 1113443473, 1113443521, 1113443533, 1113443549, 1113443561, 84676453373, 84676453429
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Comments

a(1)=5 is same as A055623(1) because 5 is a single-digit number.

Examples

			a(2)=17 because this is the 2nd prime in the first run of 2 primes where p == 1 mod 4.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007, pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Mathematica
    Flatten[Table[SequencePosition[Table[If[Mod[p-1,4]==0,1,0],{p,Prime[Range[250000]]}],PadRight[ {},n,1],1],{n,12}],1][[;;,-1]]//Prime (* The program generates the first 12 terms of the sequence. *) (* Harvey P. Dale, Jul 14 2024 *)
  • PARI
    r=0;c=0;forprime(p=2,4e9,if(p%4==1,if(c++>r,r=c;print1(p", ")),c=0)) \\ Charles R Greathouse IV, Mar 22 2011
  • UBASIC
    10 'cluster primes
    20 C=1: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: E=int(N/4):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: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
    

Extensions

Entry rewritten and a(13)-a(26) added by Charles R Greathouse IV, Mar 22 2011
Edited by M. F. Hasler, May 02 2015
Definition clarified by N. J. A. Sloane, Dec 18 2022

A145994 Last prime in a run of at least 2 consecutive primes of the form 4k+3.

Original entry on oeis.org

11, 23, 47, 71, 83, 107, 131, 167, 227, 311, 367, 383, 443, 503, 631, 647, 691, 727, 751, 827, 863, 919, 971, 991, 1091, 1171, 1283, 1319, 1427, 1451, 1471, 1487, 1543, 1583, 1667, 1787, 1847, 1871, 1987, 2011, 2087, 2111, 2207, 2267, 2351, 2411, 2467, 2543, 2591, 2671, 2687
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Examples

			a(1)=11 because this sequence includes consecutive runs of any length >1 and this ending term in a run of 2 is 11.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007. Pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Cf. A039702, A055623, A145986, A145988, A145990, A145991, A145992 (run lengths), A145993 (first prime in run)

Programs

  • Maple
    A145994 := proc()
        local m,p,r,i,lp ;
        m := 3 ;
        p := 2 ;
        r := 0 ;
        for i from 2 to 1000 do
            if modp(p,4) = m then
                r := r+1 ;
            else
                if r > 1 then
                    printf("%d,",prevprime(p)) ;
                end if;
                r := 0;
            end if;
            p := nextprime(p) ;
        end do:
    end proc:
    A145994() ; # R. J. Mathar, Aug 29 2018
  • Mathematica
    Last /@ Select[Split[Select[4Range[1000]+3, PrimeQ], #2 == NextPrime[#1]&], Length[#]>1&] (* Jean-François Alcover, Mar 26 2020 *)
  • UBASIC
    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

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

A145988 Ending prime: n-th prime in the first occurrence of n consecutive primes of the form 4k + 3.

Original entry on oeis.org

3, 11, 223, 227, 491, 499, 503, 36607, 39703, 183283, 241727, 241739, 241771, 9177607, 9177611, 95949631, 105639463, 341118731, 727335359, 727335379, 1786054619, 1786054631, 22964264759, 54870713999, 79263248759
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Comments

a(1)=3 is the same as A055624(1) because 3 is a single-digit number.

Examples

			a(2)=11 because this is the 2nd prime in the first run of 2 primes where p == 3 mod 4.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007, pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    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
  • UBASIC
    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
    

Extensions

Entry rewritten by, and a(14)-a(25) from, Charles R Greathouse IV, Mar 22 2011

A145990 Primes which start a run of at least length 2 of consecutive primes == 1 (mod 4).

Original entry on oeis.org

13, 37, 89, 109, 193, 229, 277, 313, 349, 389, 449, 509, 613, 661, 701, 757, 797, 853, 877, 929, 997, 1093, 1109, 1193, 1237, 1297, 1373, 1429, 1489, 1549, 1597, 1609, 1637, 1669, 1709, 1733, 1789, 1873, 1889, 1933, 1993, 2069, 2113, 2137, 2153, 2213, 2269
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Examples

			a(1)=13 because this sequence includes consecutive runs of any length and this first term > 1 in a run of 2 is 13.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007, pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Maple
    for i from 2 to 300 do
            if (ithprime(i) mod 4) = 1  and ithprime(i-1) mod 4 <> 1 and ithprime(i+1) mod 4 = 1 then
                    printf("%d,",ithprime(i)) ;
            end if;
    end do: # R. J. Mathar, Sep 30 2011
  • Mathematica
    Prime[#+1]&/@(SequencePosition[Table[If[Mod[n,4]==1,1,0],{n,Prime[ Range[ 350]]}],{0,1,1},Overlaps->False][[All,1]]) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 02 2017 *)
  • UBASIC
    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

Extensions

Corrected and extended by Harvey P. Dale, Aug 02 2017

A055625 First prime starting a chain of exactly n consecutive primes congruent to 1 modulo 6.

Original entry on oeis.org

7, 31, 151, 3049, 7351, 1741, 19471, 118801, 498259, 148531, 406951, 2513803, 2339041, 89089369, 51662593, 73451737, 232301497, 450988159, 1558562197, 2506152301, 1444257673, 28265029657, 24061965043, 87996684091, 43553959717
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 1 modulo 6.
See A057620 for the variant where "exactly" is replaced by "at least". - M. F. Hasler, Sep 03 2016

Crossrefs

Programs

  • Fortran
    c See link in A085515.
  • 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, 1} ..}]& ][[1, 1]];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 13}] (* Jean-François Alcover, Nov 21 2018 *)

Extensions

Corrected and extended by Reiner Martin, May 19 2001
More terms from Hugo Pfoertner, Jul 31 2003
a(20)>2^31, a(21)=1444257673. - Hugo Pfoertner, Jul 31 2003
More terms from Jens Kruse Andersen, May 30 2006
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 27 2006

A145989 Run lengths of consecutive primes == 1 (mod 4) where the run length is at least 2.

Original entry on oeis.org

2, 2, 3, 2, 2, 2, 2, 2, 2, 4, 3, 2, 2, 3, 2, 4, 2, 2, 2, 3, 3, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 5, 2, 3, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Enoch Haga, Oct 26 2008

Keywords

Comments

The run lengths of 1's in A039702 are 1, 2, 1, 2, 1, 1, 1, 3,.. as listed in A091318. Deleting all 1's from A091318 generates this sequence here. - R. J. mathar, Sep 30 2011
The maximum run length in the first 1000 terms is 9. - Harvey P. Dale, Jul 27 2025

Examples

			a(1)=2 because this sequence includes consecutive runs of any length and this first occurrence > 1 is a run of 2.
		

References

  • Enoch Haga, Exploring Primes on Your PC and the Internet, 1994-2007. Pp. 30-31. ISBN 978-1-885794-24-6

Crossrefs

Programs

  • Mathematica
    Length/@Select[Split[Table[If[Mod[p,4]==1,1,0],{p,Prime[Range[500]]}]],#[[1]]==1&&Length[#]>1&] (* Harvey P. Dale, Jul 27 2025 *)
  • UBASIC
    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
Showing 1-10 of 17 results. Next