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

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

Views

Author

Robert G. Wilson v, Oct 09 2000

Keywords

Comments

See A055626 for the variant "exactly n". See A247967 for the indices of these primes. See A057620, A057621 for variants "congruent to 5 (mod 6)", resp. "(mod 3)". - M. F. Hasler, Sep 03 2016
The sequence is infinite, by Shiu's theorem. - Jonathan Sondow, Jun 22 2017

Examples

			a(6) = 1741 because this number is the first in a sequence of 6 consecutive primes all of the form 3n + 1.
		

References

  • R. K. Guy, "Unsolved Problems in Number Theory", A4

Crossrefs

Programs

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

Formula

a(n) <= A055625(n). - Zak Seidov, Aug 29 2016
a(n) = A000040(A247967(n)). a(n) = min { A055625(k); k >= n }. - M. F. Hasler, Sep 03 2016

Extensions

More terms from Don Reble, Nov 16 2003
More terms from Jens Kruse Andersen, May 30 2006
Definition clarified by Zak Seidov, Jun 19 2017

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

A181938 Isolated primes = 1 mod 6: sandwiched by primes = 5 mod 6.

Original entry on oeis.org

7, 13, 19, 43, 97, 103, 109, 127, 139, 181, 193, 229, 241, 283, 307, 313, 349, 397, 409, 421, 457, 463, 487, 499, 643, 691, 709, 769, 787, 811, 823, 829, 853, 859, 877, 883, 907, 919, 937, 967, 1021, 1051, 1093, 1153, 1171, 1279, 1303, 1423, 1429, 1447, 1483
Offset: 1

Views

Author

Zak Seidov, Apr 03 2012

Keywords

Comments

Primes p(m) = 1 mod 6 such that both p(m-1) and p(m+1) are congruent to 5 mod 6.
Corresponding indices m are 4, 6, 8, 14, 25, 27, 29, 31 (A181978).
Note that values of d = p(m+1) - p(m-1) are multiples of 6.

Examples

			7 = p(4) = 1 mod 6 and both p(3) = 5 and p(5) = 11 are congruent to 5 mod 6,
13 = p(6) = 1 mod 6 and both p(5) = 11 and p(7) = 17 are congruent to 5 mod 6,
43 = p(14) = 1 mod 6 and both p(13) = 41 and p(15) = 47 are congruent to 5 mod 6.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2, 300]], Mod[#, 6] == 1 && Mod[NextPrime[#, -1], 6] == 5 && Mod[NextPrime[#, 1], 6] == 5 &] (* T. D. Noe, Apr 04 2012 *)
    Transpose[Select[Partition[Prime[Range[250]],3,1],Mod[#[[1]],6] == Mod[#[[3]],6] == 5&&Mod[#[[2]],6]==1&]][[2]] (* Harvey P. Dale, Sep 17 2012 *)

A344093 a(n) is the smallest positive integer not already in the sequence such that a(n) + a(n-1) is the product of two distinct primes, with a(1) = 1.

Original entry on oeis.org

1, 5, 9, 6, 4, 2, 8, 7, 3, 11, 10, 12, 14, 19, 15, 18, 16, 17, 21, 13, 20, 26, 25, 30, 27, 24, 22, 29, 28, 23, 32, 33, 36, 38, 31, 34, 35, 39, 43, 42, 40, 37, 45, 41, 44, 47, 46, 48, 58, 53, 62, 49, 57, 54, 52, 59, 56, 50, 61, 68, 51, 55, 60, 63, 66, 67, 74, 69, 64
Offset: 1

Views

Author

Atticus Stewart, Aug 15 2021

Keywords

Comments

This sequence is not to be confused with A243625 (similar but with "semiprime" instead of "product of two distinct primes"). This sequence omits squares of primes, whereas semiprimes include them. This sequence is also similar to A055625, in which sums of consecutive terms are primes instead of semiprimes.
Interestingly, the first 9 terms are a permutation of the first 9 positive integers. This is also true for the first 12, 21, 30, and 48 terms, and possibly higher values as well. This suggests that every positive integer occurs, but this is unproved.

Examples

			a(4) = 6 because 6 is the smallest k such that a(3) + k is the product of two distinct primes.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=(k=1;While[MemberQ[Array[a,n-1],k]||Last/@FactorInteger[a[n-1]+k]!={1,1},k++];k);Array[a,100] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
  • Python
    terms = [1]
    previous = 1
    def isValid(num):
      counter = 0
      for possibleDiv in range(1, int(math.sqrt(num)) + 1):
        if num % possibleDiv == 0:
          counter += 1
          if num/possibleDiv % possibleDiv == 0 and possibleDiv != 1:
            return False
        if counter > 2:
          return False
      if counter == 2:
        return True
      return False
    def generateSequence(numOfTerms):
      for i in range(numOfTerms):
        testNum = 1
        valid = False
        while not valid:
          if testNum not in terms:
            possibleNum = previous + testNum
            if isValid(num):
              valid = True
              terms.append(testNum)
              previous = testNum
          testNum += 1
Showing 1-5 of 5 results.