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 14 results. Next

A168436 Terms of A046732 listed in decreasing order.

Original entry on oeis.org

987653201, 987652301, 987650231, 987643021, 987640321, 987630251, 987615203, 987603521, 987602531, 987563021, 987546103, 987542063, 987540613, 987536201, 987526103, 987502643, 987460531, 987435061, 987432601, 987423601, 987405163
Offset: 1

Views

Author

Lekraj Beedassy, Nov 25 2009

Keywords

Crossrefs

Cf. A046732.

Programs

  • Maple
    read("transforms") ; ndgs := proc(n) max(1, ilog10(n)+1) ; end proc: isA029743 := proc(n) dgs := convert(convert(n,base,10),set) ; return ( nops(dgs) = ndgs(n) ); end proc: isA006567 := proc(n) if isprime(n) then dgs := digrev(n) ; return (isprime(dgs) and dgs <> n ); else false; end if; end proc: p := 987654321 : while true do if isA006567(p) and isA029743(p) then printf("%d,\n",p) ; end if: p := prevprime(p) ; end do: # R. J. Mathar, Mar 06 2010

Extensions

a(6) and a(7) inserted and sequence extended by R. J. Mathar, Mar 06 2010

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

A048895 Bemirps: primes that yield a different prime when turned upside down with reversals of both being two more different primes.

Original entry on oeis.org

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, 11816011, 11819011, 11906981
Offset: 1

Views

Author

Keywords

Comments

Emirps that yield other emirps when turned upside down. - Lekraj Beedassy, Apr 03 2009
Invertible primes whose reversals are also invertible primes. - Lekraj Beedassy, Apr 04 2009
All terms must begin and end with a one. - T. D. Noe, Apr 21 2014
A term has to include 6 or 9. The concatenation of first n = 809 bemirp 10611091...11688981911 is a prime with 8143 digits being the smallest one for n > 1. There isn't a bemirp < 10^15 with a bemirp index (over all primes). Bemirps such that 4 associated primes are all Sophie Germain primes are 1161880189181, 1191880186181, 1819810881611, 1816810881911, ... . - Metin Sariyar, Mar 06 2020

Crossrefs

Programs

  • Mathematica
    upDown[0] = 0; upDown[1] = 1; upDown[6] = 9; upDown[8] = 8; upDown[9] = 6; fQ[p_] := Module[{revP, upDownP, revUpDownP}, If[Intersection[{2, 3, 4, 5, 7}, Union[IntegerDigits[p]]] != {}, False, revP = FromDigits[Reverse[IntegerDigits[p]]]; upDownP = FromDigits[upDown /@ IntegerDigits[p]]; revUpDownP = FromDigits[Reverse[IntegerDigits[upDownP]]]; p != revP && p != upDownP && p != revUpDownP && PrimeQ[revP] && PrimeQ[upDownP] && PrimeQ[revUpDownP]]]; t = {}; nn = 6; Do[p = 10^n; While[p < 2*10^n, p = NextPrime[p]; If[fQ[p], AppendTo[t, p]]], {n, nn}]; t (* T. D. Noe, Apr 21 2014 *)

Extensions

More terms from David W. Wilson

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

A048053 Smallest sequence of 12 consecutive reversible primes (emirps).

Original entry on oeis.org

9387802769, 9387802807, 9387802817, 9387802861, 9387802867, 9387802873, 9387802909, 9387802937, 9387802939, 9387802973, 9387802987, 9387803003
Offset: 1

Views

Author

Keywords

Examples

			The reverse of prime 9387802769 is 9672087839 is also prime, as are all of these numbers.
		

Crossrefs

A031991 Smallest n-digit norep emirp.

Original entry on oeis.org

2, 13, 107, 1069, 10247, 102367, 1023487, 10235749, 102346897
Offset: 1

Views

Author

Keywords

Crossrefs

Showing 1-10 of 14 results. Next