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-2 of 2 results.

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

A085515 Order of first occurrence of a sequence of exactly n consecutive primes of the form 6*k+1.

Original entry on oeis.org

1, 2, 3, 6, 4, 5, 7, 8, 10, 11, 9, 13, 12, 15, 16, 14, 17, 18, 21, 19, 20, 23, 22, 25, 24, 26, 31, 27, 28, 30, 29, 32, 34, 33, 35
Offset: 1

Views

Author

Hugo Pfoertner, Jul 31 2003

Keywords

Comments

This sequence gives the index of A055625(n) after sorting by increasing magnitude.

Examples

			a(3)=3, a(4)=6, a(5)=4 because the first occurrence of exactly 6 consecutive primes of the form 6*k+1 (1741,1747,1753,1759,1777,1783) occurs after the first occurrence of 3 consecutive primes of this form (151,157,163) and before the first occurrence of 4 consecutive "6k+1"-primes (3049,3061,3067,3079).
		

Crossrefs

Cf. A055625, A085516 (sorted occurrence of first runs of "6k-1" primes).

Programs

  • Fortran
    ! Program given at link.
  • Mathematica
    (* Program not suitable to compute a large number of terms. *)
    pp = Table[{p = Prime[n], Mod[p, 6]}, {n, 10^7}];
    sp = Split[pp, Mod[#1[[2]], 6] == Mod[#2[[2]], 6]&];
    b[n_] := SelectFirst[sp, Length[#] == n && MatchQ[#, {{_Integer, 1} ..}]& ][[1, 1]];
    Sort[Table[{b[n], n}, {n, 1, 16}]][[All, 2]] (* Jean-François Alcover, Nov 21 2018 *)

Extensions

More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 27 2006
a(32)-a(35) from Giovanni Resta, Aug 04 2013
Showing 1-2 of 2 results.