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-10 of 17 results. Next

A177136 a(k) is the smallest k-digit bemirp (A048895).

Original entry on oeis.org

1061, 10061, 106861, 1106881, 10806881, 100688611, 1006088861, 10000169111, 100006601911, 1000000810681, 10000000001161, 100000010086091, 1000000006096691, 10000000001016101, 100000000069088101, 1000000000016106811, 10000000000060088191, 100000000000008608611
Offset: 4

Views

Author

Lekraj Beedassy, May 03 2010

Keywords

Examples

			a(7) = 1106881 is the first 7-digit bemirp, i.e., it is the first among 7-digit emirp pairs (1106881, 1886011) which rotated through 180 degrees forms another emirp pair (1889011, 1109881).
		

Crossrefs

Extensions

More terms from Giovanni Resta, Aug 14 2019

A177137 a(n) is the largest n-digit bemirp (A048895).

Original entry on oeis.org

1901, 19001, 198901, 1909081, 19986091, 199800091, 1999880101, 19999919011, 199999069901, 1999998661891, 19999999196861, 199999990066801, 1999999999899101, 19999999999898161, 199999999998806191, 1999999999999988911, 19999999999998191191, 199999999999986661691
Offset: 4

Views

Author

Lekraj Beedassy, May 03 2010

Keywords

Examples

			a(7) = 1909081 is the last among 7-digit emirp pairs (1909081, 1809091) which rotated through 180 degrees forms another emirp pair (1806061, 1606081).
		

Crossrefs

Extensions

More terms from Giovanni Resta, Aug 14 2019

A172384 Partial sums of A048895.

Original entry on oeis.org

1061, 2152, 3753, 5654, 15715, 25806, 41807, 60808, 167669, 277560, 446161, 645062, 1751943, 2861824, 4467905, 6273966, 8083057, 9969068, 11858079, 13767160, 24574041, 35383922, 46445733, 57537544, 69147225, 80845916
Offset: 1

Views

Author

Jonathan Vos Post, Feb 01 2010

Keywords

Comments

None of these partial sums of "bemirps: primes that yield a different prime when turned upside down with reversals of both being two more different primes" is itself prime. So what is the first (nontrivial) prime partial sum of bemirps? Of emirps? Of "norep emirps": primes with distinct digits which remain prime when reversed? Of emirpimes? I suspect that G. L. Honaker, Jr. would be delighted to have any of these.

Examples

			a(26) = 1061 + 1091 + 1601 + 1901 + 10061 + 10091 + 16001 + 19001 + 106861 + 109891 + 168601 + 198901 + 1106881 + 1109881 + 1606081 + 1806061 + 1809091 + 1886011 + 1889011 + 1909081 + 10806881 + 10809881 + 11061811 + 11091811 + 11609681 + 11698691.
		

Crossrefs

A006567 Emirps (primes whose reversal is a different prime).

Original entry on oeis.org

13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389, 701, 709, 733, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 991, 1009, 1021, 1031, 1033, 1061, 1069, 1091, 1097, 1103, 1109, 1151, 1153, 1181, 1193, 1201
Offset: 1

Views

Author

Keywords

Comments

A palindrome is a word that when written in reverse results in the same word. for example, "racecar" reversed is still "racecar". Related to palindromes are semordnilaps. These are words that when written in reverse result in a distinct valid word. For example, "stressed" written in reverse is "desserts". Not all words are palindromes or semordnilaps. While certainly not all numbers are palindromes, all non-palindromic numbers when written in reverse will form semordnilaps. Narrowing to primes brings back the same trichotomy as with words: some numbers are emirps, some numbers are palindromic primes, but some words are neither.
The term "emirp" was coined by the American mathematician Jeremiah Farrell (1937-2022). - Amiram Eldar, Jun 11 2021

References

  • Martin Gardner, The Magic Numbers of Dr Matrix. Prometheus, Buffalo, NY, 1985, p. 230.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A003684, A007628 (subsequence), A046732, A048051, A048052, A048053, A048054, A048895, A004086 (read n backwards).
A007500 is the union of A002385 and this sequence.

Programs

  • Haskell
    a006567 n = a006567_list !! (n-1)
    a006567_list = filter f a000040_list where
       f p = a010051' q == 1 && q /= p  where q = a004086 p
    -- Reinhard Zumkeller, Jul 16 2014
    
  • Magma
    [ n : n in [1..1194] | n ne rev and IsPrime(n) and IsPrime(rev) where rev is Seqint(Reverse(Intseq(n))) ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Maple
    read("transforms") ; isA006567 := proc(n) local R ; if isprime(n) then R := digrev(n) ; isprime(R) and R <> n ; else false; end if; end proc:
    A006567 := proc(n) option remember ; local a; if n = 1 then 13; else a := nextprime(procname(n-1)) ; while not isA006567(a) do a := nextprime(a) ; end do; return a; end if; end proc:
    seq(A006567(n),n=1..120) ; # R. J. Mathar, May 24 2010
  • Mathematica
    fQ[n_] := Block[{idn = IntegerReverse@ n}, PrimeQ@ idn && n != idn]; Select[Prime@ Range@ 200, fQ] (* Santi Spadaro, Oct 14 2001 and modified by Robert G. Wilson v, Nov 08 2015 *)
    Select[Prime[Range[5,200]],PrimeQ[IntegerReverse[#]]&&!PalindromeQ[#]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 11 2021 *)
  • PARI
    is(n)=my(r=eval(concat(Vecrev(Str(n)))));isprime(r)&&r!=n&&isprime(n) \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    select( {is_A006567(n,r=fromdigits(Vecrev(digits(n))))=isprime(r)&&r!=n&&isprime(n)}, primes(200)) \\ M. F. Hasler, Jan 31 2020
    
  • Python
    from sympy import prime, isprime
    A006567 = [p for p in (prime(n) for n in range(1,10**6)) if str(p) != str(p)[::-1] and isprime(int(str(p)[::-1]))] # Chai Wah Wu, Aug 14 2014
    
  • Python
    from sympy import isprime, nextprime
    def emirps(start=1, end=float('inf')): # generator for emirps in start..end
        p = nextprime(start-1)
        while p <= end:
            s = str(p)
            if s[0] in "24568":
                p = nextprime((int(s[0])+1)*10**(len(s)-1)); continue
            revp = int(s[::-1])
            if p != revp and isprime(revp): yield p
            p = nextprime(p)
    print(list(emirps(end=1201))) # Michael S. Branicky, Jan 24 2021, updated Jul 28 2022

Extensions

More terms from James Sellers, Jan 22 2000

A048054 Number of n-digit reversible primes (emirps).

Original entry on oeis.org

4, 9, 43, 204, 1499, 9538, 71142, 535578, 4197196, 33619380, 274932272, 2294771254, 19489886063, 167630912672, 1456476399463
Offset: 1

Views

Author

Keywords

Comments

The count includes palindromes.

Examples

			2, 3, 5 and 7 are 1-digit reversible primes, so a(1)=4.
		

Crossrefs

Programs

  • Mathematica
    Count[Range[10^(# - 1), 10^# - 1], n_ /; And[PrimeQ@ n, PrimeQ@ FromDigits@ Reverse@ IntegerDigits@ n]] & /@ Range@ 7 (* Michael De Vlieger, Jul 14 2015 *)
  • Python
    from sympy import isprime, primerange
    def A048054(n):
        return len([p for p in primerange(10**(n-1),10**n)
                    if isprime(int(str(p)[::-1]))]) # Chai Wah Wu, Aug 14 2014

Extensions

a(11)-a(13) from Giovanni Resta, Jul 19 2015
a(14)-a(15) from Cécile Dartyge, Bruno Martin, Joël Rivat, Igor E. Shparlinski, and Cathy Swaenepoel, Oct 05 2023

A003684 Number of n-digit reversible primes (or emirps) with distinct digits.

Original entry on oeis.org

4, 8, 22, 84, 402, 1218, 3572, 8218, 11804
Offset: 1

Views

Author

Keywords

Examples

			13, 17, 31, 37, 71, 73, 79 and 97 are reversible primes (emirps), so a(2)=8.
		

Crossrefs

Programs

  • Mathematica
    emrpQ[n_]:=Module[{idn=IntegerDigits[n],rev},rev=Reverse[idn];rev!=idn && Max[DigitCount[n]] ==1&&PrimeQ[FromDigits[rev]]]; With[{ems=Select[ Prime[ Range[ 51*10^6]],emrpQ]},Join[ {4},Table[Count[ems,?(IntegerLength[ #] == n&)],{n,2,9}]]] (* _Harvey P. Dale, Nov 29 2014 *)
  • Python
    from sympy import primerange, isprime
    def A003684(n):
        return len([p for p in primerange(10**(n-1),10**n)
        if len(set(str(p))) == len(str(p)) and isprime(int(str(p)[::-1]))])
    # Chai Wah Wu, Aug 14 2014

Extensions

Typo in example corrected by David Ritterskamp (dritters(AT)usi.edu), Mar 24 2008

A048052 Start of the first occurrence of n consecutive reversible primes (emirps).

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 727, 1193, 1193, 1477271183, 9387802769, 15423094826093
Offset: 1

Views

Author

Keywords

Comments

Palindromic primes are allowed.

Examples

			2, 3, 5, 7, 11, 13 and 17 are consecutive reversible primes, so a(7) = 2.
		

Crossrefs

Cf. A040104 (n=10), A048051 (n=11), A048053 (n=12), A003684, A006567, A007628, A046732, A048054, A048895.

Extensions

Corrected by Rick L. Shepherd, May 28 2002
a(13) from Giovanni Resta, Nov 07 2019

A046732 "Norep emirps": primes with distinct digits which remain prime when reversed.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97, 107, 149, 157, 167, 179, 347, 359, 389, 701, 709, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 1069, 1097, 1237, 1249, 1259, 1279, 1283, 1409, 1429, 1439, 1453, 1487, 1523, 1583, 1597, 1657, 1723, 1753
Offset: 1

Views

Author

Keywords

Comments

There are no 10-digit terms because their sum of digits would be 45 and thus the number would be divisible by 3.
There are 25332 terms in this sequence, the last of which is 987653201, as found by Harvey P. Dale. - see Martin Gardner's column in Scientific American.

Crossrefs

Programs

  • Maple
    read(transforms): A046732 := proc(n) option remember: local d,k,p,distdig: if(n=1)then return 2: fi: p:=procname(n-1): do p:=nextprime(p): if(isprime(digrev(p)))then d:=convert(p,base,10): distdig:=true: for k from 0 to 9 do if(numboccur(d,k)>1)then distdig:=false: break: fi: od: if(distdig)then return p: fi: fi: od: end: seq(A046732(n),n=1..52); # Nathaniel Johnston, May 29 2011
  • Mathematica
    Select[Prime[Range[280]], Length[Union[x = IntegerDigits[#]]] == Length[x] && PrimeQ[FromDigits[Reverse[x]]] &] (* Jayanta Basu, Jun 28 2013 *)
  • Python
    from sympy import prime, isprime
    A046732 = [p for p in (prime(n) for n in range(1,10**3)) if len(str(p)) == len(set(str(p))) and isprime(int(str(p)[::-1]))] # Chai Wah Wu, Aug 14 2014

Extensions

More terms from Jud McCranie.

A007628 Reflectable emirps.

Original entry on oeis.org

13, 31, 113, 311, 1031, 1033, 1103, 1181, 1301, 1381, 1811, 1831, 3011, 3083, 3301, 3803, 10333, 11003, 11083, 11833, 18013, 18133, 18803, 30011, 30881, 31033, 31081, 31183, 33013, 33181, 33301, 33811, 38011, 38113
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A125308, the reflectable primes. - Reinhard Zumkeller, Jul 16 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • C. W. Trigg, "Reflective Primes", J. Rec. Math., 15 (1983), 251-256.

Crossrefs

Programs

  • Haskell
    a007628 n = a007628_list !! (n-1)
    a007628_list = filter f a125308_list where
       f p = a010051' q == 1 && q /= p  where q = a004086 p
    -- Reinhard Zumkeller, Jul 16 2014

Extensions

Missing 1811 inserted by Reinhard Zumkeller, Jul 16 2014

A048051 First occurrence of 11 consecutive and reversible primes (emirps).

Original entry on oeis.org

1477271183, 1477271249, 1477271251, 1477271269, 1477271291, 1477271311, 1477271317, 1477271351, 1477271357, 1477271381, 1477271387
Offset: 1

Views

Author

Keywords

Examples

			The reverse of prime 1477271183 is 3811727741 is also prime, as are all of these numbers.
		

Crossrefs

Showing 1-10 of 17 results. Next