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

A346024 Primes that are the first in a run of exactly 4 emirps.

Original entry on oeis.org

733, 7177, 9011, 11551, 11777, 12107, 13147, 13259, 13693, 14563, 19219, 19531, 19661, 31891, 32467, 35117, 35311, 36097, 36187, 38351, 38903, 70241, 70921, 75721, 77323, 78607, 79399, 79531, 90121, 91183, 92297, 92479, 92959, 93581, 94121, 95111, 95791, 96857
Offset: 1

Views

Author

Lars Blomberg, Jul 02 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 733 because of the six consecutive primes 727, 733, 739, 743, 751, 757 all except 727 and 757 are emirps and this is the first such occurrence.
		

Crossrefs

Subsequence of A006567 (emirps)

Programs

  • Mathematica
    Select[Prime@Range@10000,Boole[PrimeQ@#&&!PalindromeQ@#&/@(IntegerReverse/@NextPrime[#,Range[-1,4]])]=={0,1,1,1,1,0}&] (* Giorgos Kalogeropoulos, Jul 04 2021 *)
  • Python
    from sympy import isprime, primerange
    def isemirp(p): s = str(p); return s != s[::-1] and isprime(int(s[::-1]))
    def aupto(limit):
        alst, pvec, evec = [], [2, 3, 5, 7, 11, 13], [0, 0, 0, 0, 0, 0]
        for p in primerange(17, limit+1):
            if evec == [0, 1, 1, 1, 1, 0]: alst.append(pvec[1])
            pvec = pvec[1:] + [p]; evec = evec[1:] + [isemirp(p)]
        return alst
    print(aupto(97000)) # Michael S. Branicky, Jul 04 2021

A346025 Primes that are the first in a run of exactly 5 emirps.

Original entry on oeis.org

3371, 9769, 11699, 11953, 15493, 34549, 72307, 72547, 105653, 106391, 109849, 129587, 139387, 144407, 169067, 170759, 178333, 193261, 193877, 316073, 324031, 324893, 325163, 333923, 339671, 375787, 381859, 389287, 701383, 701593, 712289, 722633, 744377, 777349
Offset: 1

Views

Author

Lars Blomberg, Jul 02 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 3371 because of the seven consecutive primes 3361, 3371, 3373, 3389, 3391, 3407, 3413 all except 3361 and 3413 are emirps and this is the first such occurrence.
		

Crossrefs

Subsequence of A006567 (emirps).

Programs

  • Mathematica
    Select[Prime@Range@20000,Boole[PrimeQ@#&&!PalindromeQ@#&/@(IntegerReverse/@NextPrime[#,Range[-1,5]])]=={0,1,1,1,1,1,0}&] (* Giorgos Kalogeropoulos, Jul 04 2021 *)
  • Python
    from sympy import isprime, primerange
    def isemirp(p): s = str(p); return s != s[::-1] and isprime(int(s[::-1]))
    def aupto(limit):
        alst, pvec, evec = [], [2, 3, 5, 7, 11, 13, 17], [0, 0, 0, 0, 0, 0, 0]
        for p in primerange(19, limit+1):
            if evec == [0, 1, 1, 1, 1, 1, 0]: alst.append(pvec[1])
            pvec = pvec[1:] + [p]; evec = evec[1:] + [isemirp(p)]
        return alst
    print(aupto(780000)) # Michael S. Branicky, Jul 04 2021

A346026 Primes that are the first in a run of exactly 6 emirps.

Original entry on oeis.org

10039, 14891, 39791, 119773, 149561, 162293, 163781, 176903, 181751, 197383, 336689, 392911, 393361, 714361, 715361, 779003, 971141, 995443, 996539, 1165037, 1284487, 1307729, 1447151, 1611877, 1640539, 1789621, 1891147, 3136909, 3150557, 3284447, 3339943
Offset: 1

Views

Author

Lars Blomberg, Jul 14 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 10039 because of the eight consecutive primes 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093 all except 10037 and 10093 are emirps and this is the first such occurrence.
		

Crossrefs

Subsequence of A006567 (emirps).

Programs

  • Mathematica
    EmQ[n_]:=(s=IntegerReverse@n;PrimeQ@s&&n!=s);
    Select[Prime@Range[2,50000],Boole[EmQ/@NextPrime[#,Range[-1,6]]]=={0,1,1,1,1,1,1,0}&] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
  • Python
    from sympy import isprime, nextprime, prime, primerange
    def isemirp(p): s = str(p); return s != s[::-1] and isprime(int(s[::-1]))
    def aupto(limit, runlength=6):
      alst = []
      pvec = list(primerange(1, prime(runlength+2)+1))
      evec = [int(isemirp(p)) for p in pvec]
      target = [0] + [1 for i in range(runlength)] + [0]
      p = nextprime(pvec[-1])
      while pvec[1] <= limit:
        if evec == target: alst.append(pvec[1])
        pvec = pvec[1:] + [p]; evec = evec[1:] + [isemirp(p)]; p = nextprime(p)
        strp = str(p)
        if strp[0] in "24568": # skip large gaps (p is a prime, not an emirp)
          evec = [0 for i in range(runlength+2)]
          pvec = [0 for i in range(runlength+2)]
          p = nextprime(int(str(int(strp[0])+1)+'0'*(len(strp)-1)))
      return alst
    print(aupto(3339943)) # Michael S. Branicky, Jul 14 2021

A346027 Primes that are the first in a run of exactly 7 emirps.

Original entry on oeis.org

11897, 18719, 125627, 743989, 910909, 920957, 928429, 941449, 1093571, 1407181, 1466533, 1518863, 1648553, 1770829, 3170743, 3300593, 7321943, 7682687, 7755581, 9013351, 12890047, 13267459, 14113199, 16413013, 16944341, 17316031, 18447001, 18490267, 18964111
Offset: 1

Views

Author

Lars Blomberg, Jul 14 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 11897 because of the nine consecutive primes 11887, 11897, 11903, 11909, 11923, 11927, 11933, 11939, 11941 all except 11887 and 11941 are emirps and this is the first such occurrence.
		

Crossrefs

Subsequence of A006567 (emirps).

Programs

  • Mathematica
    EmQ[n_]:=(s=IntegerReverse@n;PrimeQ@s&&n!=s);
    Monitor[Do[p=Prime@k;If[MemberQ[{1,3,7,9},First@IntegerDigits@p],If[Boole[EmQ/@NextPrime[p,Range[-1,7]]]=={0,1,1,1,1,1,1,1,0},Print@p]],{k,10^6}],p] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
  • Python
    # uses code in A346026
    print(aupto(10**7, runlength=7)) # Michael S. Branicky, Jul 14 2021

A346028 Primes that are the first in a run of exactly 8 emirps.

Original entry on oeis.org

334759, 9094009, 9685771, 11875307, 12503017, 19776443, 32906869, 35414443, 37376201, 70252333, 71161309, 73694129, 77454067, 93907523, 98606489, 100545637, 104827991, 112604857, 147009703, 155376791, 183766217, 187717499, 194024953, 196702423, 314716411
Offset: 1

Views

Author

Lars Blomberg, Jul 14 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 334759 because of the 10 consecutive primes 334753, 334759, 334771, 334777, 334783, 334787, 334793, 334843, 334861, 334877 all except 334753 and 334877 are emirps and this is the first such occurrence.
		

Crossrefs

Programs

  • Mathematica
    EmQ[n_]:=(s=IntegerReverse@n;PrimeQ@s&&n!=s);
    Monitor[Do[p=Prime@k;If[MemberQ[{1,3,7,9},First@IntegerDigits@p],If[Boole[EmQ/@NextPrime[p,Range[-1,8]]]=={0,1,1,1,1,1,1,1,1,0},Print@p]],{k,10^6}],p] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
  • Python
    # uses code in A346026
    print(aupto(10**7, runlength=8)) # Michael S. Branicky, Jul 14 2021

A346029 Primes that are the first in a run of exactly 9 emirps.

Original entry on oeis.org

7904639, 120890249, 154984343, 174625597, 312700789, 318629783, 707262887, 756791029, 923780981, 958610069, 1049344897, 1068171977, 1117675201, 1194919381, 1327765591, 1368391847, 1385828243, 1846629391, 1976590081, 3117896521, 3182618969, 3322051367
Offset: 1

Views

Author

Lars Blomberg, Jul 14 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 7904639 because of the 11 consecutive primes 7904629, 7904639, 7904651, 7904653, 7904657, 7904669, 7904683, 7904707, 7904719, 7904723, 7904731 all except 7904629 and 7904731 are emirps and this is the first such occurrence.
		

Crossrefs

Programs

  • Mathematica
    EmQ[n_]:=(s=IntegerReverse@n;PrimeQ@s&&n!=s);
    Monitor[Do[p=Prime@k;If[MemberQ[{1,3,7,9},First@IntegerDigits@p],If[Boole[EmQ/@NextPrime[p,Range[-1,9]]]==Join[{0},1~Table~9,{0}],Print@p]],{k,10^8}],p] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
  • Python
    # uses code in A346026
    print(aupto(10**7, runlength=9)) # Michael S. Branicky, Jul 14 2021

A346021 Primes that are the first in a run of exactly 1 emirp.

Original entry on oeis.org

97, 107, 113, 149, 157, 167, 179, 199, 311, 359, 389, 907, 1009, 1061, 1069, 1091, 1181, 1301, 1321, 1429, 1439, 1453, 1471, 1487, 1559, 1619, 1657, 1669, 1753, 1789, 1811, 1867, 1879, 1901, 1913, 1979, 3049, 3067, 3121, 3163, 3169, 3221, 3251, 3257, 3319
Offset: 1

Views

Author

Lars Blomberg, Jul 14 2021

Keywords

Comments

There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.

Examples

			a(1) = 97 because of the three consecutive primes 89, 97, 101 only 97 is an emirp and this is the first such occurrence.
		

Crossrefs

Programs

  • Mathematica
    emirpQ[p_] := (r = IntegerReverse[p]) != p && PrimeQ[r]; p = Select[Range[3400], PrimeQ]; p[[1 + Position[Partition[emirpQ /@ p, 3, 1], {False, True, False}] // Flatten]] (* Amiram Eldar, Jul 14 2021 *)
  • Python
    from sympy import isprime, nextprime
    def isemirp(p): s = str(p); return s != s[::-1] and isprime(int(s[::-1]))
    def aupto(limit):
      alst, pvec, evec, p = [], [2, 3, 5], [0, 0, 0], 7
      while pvec[1] <= limit:
        if evec == [0, 1, 0]: alst.append(pvec[1])
        pvec = pvec[1:] + [p]; evec = evec[1:] + [isemirp(p)]; p = nextprime(p)
      return alst
    print(aupto(3319)) # Michael S. Branicky, Jul 14 2021
Showing 1-7 of 7 results.