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.

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

A258084 Numbers n such that n concatenated with its reversal n' yields a prime when the rightmost digit of n and leftmost digit of n' are coalesced.

Original entry on oeis.org

2, 3, 5, 7, 10, 13, 15, 18, 19, 31, 35, 37, 38, 72, 75, 78, 79, 91, 92, 100, 103, 105, 106, 113, 114, 124, 127, 128, 133, 138, 139, 143, 147, 154, 155, 163, 165, 166, 174, 179, 181, 184, 193, 198, 199, 301, 302, 304, 307, 308, 315, 323, 324, 335, 345, 348, 351
Offset: 1

Views

Author

K. D. Bajpai, May 19 2015

Keywords

Comments

Alternatively, numbers n such that if n is concatenated with its reversal n', blending together the rightmost digit of n and the leftmost digit of n' yields a prime.
Leading zeros of n’ are discarded. For example, with 100, the reversal is 001; discarding its leading zeros gives 1; since the rightmost digit of 100 does not coincide with the leftmost digit 1 of n’, discard the rightmost digit of 100 - that results in the concatenated number 101, which is prime.
All the terms in this sequence will generate (probably) palindromic primes.

Examples

			a(6) = 13: Reversal of its digits gives 31. Concatenating 13 with 31, blending together 3's, results in 131, which is prime.
a(26) = 124: Reversal of its digits gives 421. Concatenating 124 with 421, blending together 4's, results in 12421, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1, 1200], PrimeQ[FromDigits[Join[IntegerDigits [FromDigits [Join[Most [IntegerDigits[#]]]]], IntegerDigits[FromDigits [Reverse[IntegerDigits[#]]]]]] ] &]
  • PARI
    for(n=1,200,d=digits(n);m=(10^#d)*floor(n/10);s=sum(i=1,#d,d[i]*10^(i-1));if(isprime(m+s),print1(n,", "))) \\ Derek Orr, Jun 22 2015
Showing 1-2 of 2 results.