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.

Previous Showing 11-20 of 24 results. Next

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

A054217 Primes p with property that p concatenated with its emirp p' (prime reversal) forms a palindromic prime of the form 'primemirp' (rightmost digit of p and leftmost digit of p' are blended together - p and p' palindromic allowed).

Original entry on oeis.org

2, 3, 5, 7, 13, 31, 37, 79, 113, 179, 181, 199, 353, 727, 787, 907, 937, 967, 983, 1153, 1193, 1201, 1409, 1583, 1597, 1657, 1831, 1879, 3083, 3089, 3319, 3343, 3391, 3541, 3643, 3853, 7057, 7177, 7507, 7681, 7867, 7949, 9103, 9127, 9173, 9209, 9439, 9547, 9601
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

Original idea from G. L. Honaker, Jr..

Examples

			E.g., prime 113 has emirp 311 and 11311 is a palindromic prime, so 113 is a term.
		

Crossrefs

Programs

  • Mathematica
    empQ[n_]:=Module[{idn=IntegerDigits[n],rev},rev=Reverse[idn];And@@PrimeQ[ {FromDigits[ rev],FromDigits[Join[Most[idn],rev]]}]]; Select[Prime[ Range[ 1200]],empQ] (* Harvey P. Dale, Mar 26 2013 *)
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        s = str(n); srev = s[::-1]
        return isprime(int(srev)) and isprime(int(s[:-1] + srev))
    print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, Nov 17 2023

Extensions

Corrected (a(30)=3089 inserted) by Harvey P. Dale, Mar 26 2013

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

A054218 Palindromic primes of the form 'primemirp' resulting from A054217.

Original entry on oeis.org

2, 3, 5, 7, 131, 313, 373, 797, 11311, 17971, 18181, 19991, 35353, 72727, 78787, 90709, 93739, 96769, 98389, 1153511, 1193911, 1201021, 1409041, 1583851, 1597951, 1657561, 1831381, 1879781, 3083803, 3089803, 3319133, 3343433, 3391933, 3541453, 3643463
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

Original idea from G. L. Honaker, Jr.

Examples

			Prime 113 has emirp 311 and 11311 is a palindromic prime.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    for i in range(2,10**7):
        if isprime(i):
            emirp = int(str(i)[-1::-1])
            if isprime(emirp):
                primemirp = int(str(i)+str(emirp)[1:])
                if isprime(primemirp):
                    print(primemirp)
    # Peter Rowlett, Nov 16 2023

Extensions

a(33)-a(35) from Peter Rowlett, Nov 16 2023

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

A178545 Primes p such that q = p^2 + p + 1 is an emirp.

Original entry on oeis.org

3, 5, 41, 59, 839, 857, 1811, 1931, 3011, 3221, 3407, 3671, 8387, 8543, 8627, 9719, 9743, 9803, 10781, 11549, 12647, 13469, 13487, 13499, 13613, 13931, 14087, 17477, 17573, 17837, 18089, 18269, 19319, 19403, 19661, 19991, 27191, 27947, 31223, 33311, 34313
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), May 29 2010

Keywords

Comments

It is conjectured (but still an open problem) that there exist infinitely many primes of the form n^2 + n + 1 = ((2*n+1)^2 + 3)/4.
Landau's 4th problem from (1912, 5th Congress of Mathematicians in Cambridge) conjectures that there are infinitely many primes of the form n^2 + 1 (also Euler 1760; Mirsky 1949).
Hardy and Littlewood proposed a conjecture about the asymptotic number of primes of the form n^2 + 1.
An emirp ("prime" spelled backwards) is a prime whose reversal is a different prime, the reversal of q is denoted by R(q).
It is conjectured but also unproved that there are infinitely many emirps (see A048054).
For p > 3 necessarily p of the form 6*k + 5 as (6*k+1)^2 + (6*k+1) + 1 a multiple of 3.

Examples

			3^2 + 3 + 1 = 13 = prime(6), R(13) = prime(11), 3 is first term.
5^2 + 5 + 1 = 31 = prime(11), R(31) = prime(6), 5 is 2nd term.
q = 1811^2 + 1811 + 1 = 3281533 = prime(235691), R(q) = prime(240351), first case that p = 1811 = prime(280) = emirp(87) is itself an emirp.
		

References

  • M. Gardner: Die magischen Zahlen des Dr. Matrix, Krueger Verlag, Frankfurt am Main, 1987
  • R. Guy: Unsolved Problems in Number Theory,3rd edition, Springer, New York, 2004
  • G. H. Hardy, E. M. Wright: Einfuehrung in die Zahlentheorie, R. Oldenburg, Muenchen, 1958

Crossrefs

Programs

  • Maple
    filter:= proc(p) local q,qr;
       if not isprime(p) then return false fi;
       q:= p^2+p+1;
       if not isprime(q) then return false fi;
       qr:= revdigs(q);
       qr <> q and isprime(qr);
    end proc:
    select(filter, [3,seq(i,i=5..50000,6)]); # Robert Israel, Dec 04 2016
  • Mathematica
    EmirpQ[n_] := If[ PrimeQ@n, Block[{id = IntegerDigits@n}, rid = Reverse@ id; rid != id && PrimeQ@ FromDigits@ rid]]; Select[ Prime@ Range@ 3700, EmirpQ[ #^2 + # + 1] &] (* Robert G. Wilson v, Jul 26 2010 *)
    p2emrpQ[p_]:=With[{q=p^2+p+1},!PalindromeQ[q]&&AllTrue[{q,IntegerReverse[q]},PrimeQ]]; Select[Prime[Range[3700]],p2emrpQ] (* Harvey P. Dale, Mar 10 2025 *)

Extensions

More terms from Robert G. Wilson v, Jul 26 2010

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

A366910 Number of n-bit binary reversible primes.

Original entry on oeis.org

0, 1, 2, 2, 4, 6, 9, 14, 27, 36, 69, 94, 178, 308, 589, 908, 1540, 2814, 5158, 9210, 16732, 29392, 55109, 101120, 179654, 332130, 625928, 1136814, 2120399, 3963166, 7377931, 13878622, 25958590, 48421044, 92163237, 173672988, 325098134, 617741968, 1177573074, 2221353224, 4222570054
Offset: 1

Views

Author

Cathy Swaenepoel, Oct 27 2023

Keywords

Comments

Number of primes p in [2^(n-1),2^n) whose reverse in base 2 is also prime. The count includes palindromic primes in base 2.

Examples

			The 5-bit binary reversible primes are 17="10001", 23="10111", 29="11101" and 31="11111", so a(5)=4.
		

Crossrefs

Previous Showing 11-20 of 24 results. Next