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 51-60 of 89 results. Next

A180022 Primes that can be obtained from other primes by interchanging the first and last digits. The source prime and the resulting prime are written consecutively.

Original entry on oeis.org

11, 11, 13, 31, 17, 71, 31, 13, 37, 73, 71, 17, 73, 37, 79, 97, 97, 79, 101, 101, 107, 701, 113, 311, 131, 131, 149, 941, 151, 151, 157, 751, 167, 761, 179, 971, 181, 181, 191, 191, 199, 991, 311, 113, 313, 313, 337, 733, 347, 743, 353, 353, 359, 953, 373, 373
Offset: 1

Views

Author

Parthasarathy Nambi, Aug 06 2010

Keywords

Comments

This sequence is different from A007500 and A069706. [From Parthasarathy Nambi, Aug 07 2010]

Examples

			389 is a prime and the prime 983 is obtained by interchanging the first and last digits.
		

Crossrefs

Cf. A007500,A069706. [From Parthasarathy Nambi, Aug 07 2010]

A085299 a(n) is the smallest number x such that A085298[x]=n, or 0 if no such number exists.

Original entry on oeis.org

1, 8, 47, 18, 14, 89, 10, 9, 48, 16, 23, 17, 168, 268, 15, 661, 50, 380, 84, 116, 360, 245, 29, 144, 345, 227, 785, 261, 148, 235, 691, 658, 638, 40, 1023, 674, 1529, 210, 19, 81, 181, 428, 170, 1130, 2322, 406, 600, 373, 958, 217
Offset: 1

Views

Author

Labos Elemer, Jun 24 2003

Keywords

Examples

			a(13) = 168 means that 13 is the smallest exponent such that reversed[p(168)^13] = reversed[997^13] = 776831144302925059735912605306533496169
is prime if read in this direction and 13th prime-power if read backwards.
		

Crossrefs

A127746 Smallest n-digit prime whose reversal is also prime.

Original entry on oeis.org

2, 13, 107, 1009, 10007, 100049, 1000033, 10000169, 100000007, 1000000007, 10000000207, 100000000237, 1000000000091, 10000000000313, 100000000000261, 1000000000000273, 10000000000000079, 100000000000000049
Offset: 1

Views

Author

Lekraj Beedassy, Jan 28 2007

Keywords

Comments

Smallest n-digit emirp (A006567).
Largest n-digit emirp is given by A114019.
Least emirp (A006567) greater than 10^(n-1). [Jonathan Vos Post, Nov 15 2009]
Palindromes not permitted (with the exception of the first term), so for example 101 is not a term. - Harvey P. Dale, Mar 11 2017

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 10^(n - 1), id, rid}, While[ id = IntegerDigits[k]; rid = Reverse[id]; ! PrimeQ[k] || ! PrimeQ[FromDigits[rid]] || id == rid, k++ ]; k]; Table[f[n], {n, 2, 19}] (* Ray Chandler, Jan 30 2007 *)
    sndp[n_]:=Module[{np=NextPrime[10^(n+1)]},While[PalindromeQ[np] || !PrimeQ[ IntegerReverse[ np]],np= NextPrime[np]];np]; Join[{2},Array[sndp,20,0]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 11 2017 *)

Extensions

Edited and extended by Ray Chandler, Jan 30 2007

A136186 Primes whose decimal and binary reversal are both prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 97, 101, 107, 113, 131, 151, 167, 181, 199, 313, 337, 353, 359, 373, 383, 701, 709, 727, 739, 757, 797, 907, 937, 941, 953, 967, 1033, 1091, 1109, 1153, 1181, 1193, 1201, 1217, 1229, 1259, 1439, 1453, 1471, 1487, 1619, 1669
Offset: 1

Views

Author

Harry J. Smith, Dec 19 2007

Keywords

Examples

			337 = 101010001 base 2, reverse the sequence of ones and zeros: 100010101 base 2 = 277. 337, 733 and 277 are all prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[300]],AllTrue[{IntegerReverse[#],FromDigits[ Reverse[ IntegerDigits[ #,2]],2]},PrimeQ]&] (* Harvey P. Dale, Nov 11 2021 *)

A141263 Lesser of a prime/emirp pair.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 37, 79, 101, 107, 113, 131, 149, 151, 157, 167, 179, 181, 191, 199, 313, 337, 347, 353, 359, 373, 383, 389, 709, 727, 739, 757, 769, 787, 797, 919, 929, 1009, 1021, 1031, 1033, 1061, 1069, 1091, 1097, 1103, 1109, 1151, 1153, 1181
Offset: 1

Views

Author

Artur Jasinski, Jun 20 2008

Keywords

Comments

From the set of numbers that are both prime and emirp choose the smaller one of each pair (whenever more than one decimal digit is involved).
A002385 is subset of this sequence.

Examples

			31 does not appear since we have already seen 13.
		

Crossrefs

Programs

  • Mathematica
    pp[n_] := Module[{nr=FromDigits[Reverse[IntegerDigits[n]]]}, If[PrimeQ[nr],Sort[{n,nr}]]]; Transpose[Rest[Union[pp/@Prime[Range[200]]]]][[1]] (* Harvey P. Dale, Dec 18 2010 *)
  • Python
    from gmpy2 import next_prime, is_prime
    A141263_list, p = [], 1
    for _ in range(1, 10**4):
        p = next_prime(p)
        ps = int(str(p)[::-1])
        if p <= ps and is_prime(ps):
            A141263_list.append(int(p)) # Chai Wah Wu, Jun 11 2015

A160748 Primes whose digits are primes and reverse is prime.

Original entry on oeis.org

2, 3, 5, 7, 37, 73, 337, 353, 373, 727, 733, 757, 3257, 3373, 3527, 3733, 7253, 7523, 7577, 7757, 32233, 32257, 32323, 32353, 32377, 32537, 33223, 33533, 35227, 35257, 35323, 35327, 35353, 35537, 35753, 37273, 37573, 72227, 72253, 72337, 72353
Offset: 1

Views

Author

Vincenzo Librandi, Jan 24 2010

Keywords

Comments

Intersection of A007500 and A019546. - Michel Marcus, Dec 04 2015

Crossrefs

Cf. A007500 (reversible primes), A019546 (primes with prime digits).

Programs

  • Magma
    [p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [2,3,5,7] and IsPrime(Seqint(Reverse(Intseq(p))))]; // Vincenzo Librandi, Dec 04 2015
  • Maple
    listtoint:= proc(L) local i; add(L[i]*10^(i-1),i=1..nops(L)) end proc:
    f:= proc(L) local s;
      s:= listtoint(L);
      if isprime(s) and isprime(listtoint(ListTools:-Reverse(L))) then s fi
    end proc:
    Cands:= [[3],[7]]:
    A:= 2,3,5,7:
    for m from 2 to 6 do
      Cands:= map(t -> seq([op(t),j], j=[2,3,5,7]), Cands);
      A:= A, op(sort(map(f,Cands)));
    od:
    A; # Robert Israel, Dec 04 2015
  • Mathematica
    okQ[p_] := PrimeQ[IntegerReverse[p] && AllTrue[IntegerDigits[p], PrimeQ]];
    Select[Prime[Range[10^4]], okQ] (* Jean-François Alcover, Feb 06 2018 *)

A161721 Primes p such that the reversal of p is prime and the product of p with its reversal is a palindrome.

Original entry on oeis.org

2, 3, 11, 101, 1021, 1201, 111211, 112111, 1000211, 1010201, 1020101, 1101211, 1102111, 1111021, 1112011, 1120001, 1121011, 1201111, 10011101, 10012001, 10021001, 10100201, 10111001, 10200101, 11012011, 11021011, 11100121, 12100111
Offset: 1

Views

Author

Tanya Khovanova, Jun 17 2009

Keywords

Comments

This sequence is a subsequence of A062936. If you multiply a member of this sequence by its reversal you get a number fixed under TITO algorithm (see A161594).
Conjecture: except for a(2) which equals 3, all terms can only be composed of the digits 0, 1 or 2. - Chai Wah Wu, Jan 07 2015
Conjecture: the digit 2 can only appear once in each term. - Robert G. Wilson v, Jan 07 2015
Number of terms less than 10^n: 2, 3, 4, 6, 6, 8, 18, 28, 37, 65, 97, 153, 230, 304, 414, 556, 756, 960, 1255, ... - Robert G. Wilson v, Jan 07 2015
A proper subset of A007500. - Robert G. Wilson v, Jan 07 2015

Examples

			1021 is a prime number, its reversal is 1201, which is also a prime. The product 1021*1201 = 1226221 is a palindrome.
		

Crossrefs

Programs

  • Maple
    rev := proc (n) local nn: nn := convert(n, base, 10): add(nn[j]*10^(nops(nn)-j), j = 1 .. nops(nn)) end proc: a := proc (n) local p: p := ithprime(n): if isprime(rev(p)) = true and rev(p*rev(p)) = p*rev(p) then p else end if end proc: seq(a(n), n = 1 .. 800000); # Emeric Deutsch, Jun 26 2009
  • Mathematica
    rev[n_]:=FromDigits[Reverse[IntegerDigits[n]]]; t={}; Do[p=Prime[n]; If[PrimeQ[q=rev[p]] && rev[p*q]==p*q, AppendTo[t,p]], {n,8*10^5}]; t (* Jayanta Basu, May 11 2013 *)
  • Python
    from sympy import isprime
    A161721_list = [2]
    for i in range(3,10**6,2):
        j = int(str(i)[::-1])
        if j == i:
            s = str(i**2)
            if s == s[::-1] and isprime(i):
                A161721_list.append(i)
        elif j > i:
            s = str(i*j)
            if s == s[::-1] and isprime(i) and isprime(j):
                A161721_list.extend([i,j])
    A161721_list = sorted(A161721_list) # Chai Wah Wu, Jan 07 2015

Extensions

Edited by N. J. A. Sloane, Jun 23 2009
More terms from Emeric Deutsch, Jun 26 2009

A167215 Primes whose reversal + 1 is also prime.

Original entry on oeis.org

2, 61, 211, 271, 277, 283, 601, 613, 631, 643, 661, 691, 829, 853, 883, 2011, 2017, 2029, 2083, 2089, 2143, 2161, 2203, 2221, 2239, 2251, 2269, 2281, 2287, 2293, 2341, 2347, 2371, 2383, 2389, 2467, 2551, 2683, 2719, 2731, 2749, 2767, 2791, 2803, 2851
Offset: 1

Views

Author

Claudio Meller, Oct 30 2009

Keywords

Comments

61 is prime and 16+1 = 17 is also a prime.

Crossrefs

Cf. A007500.

Programs

  • Magma
    [p: p in PrimesUpTo(3000) | IsPrime((Seqint(Reverse(Intseq(p)))) + 1)]; // Vincenzo Librandi, Feb 25 2020
  • Mathematica
    Select[Prime[Range[500]], PrimeQ[IntegerReverse[#] + 1] &] (* Vincenzo Librandi, Feb 25 2020 *)

A167992 Least n-digit emirp (A006567) with emirp digital sum, or 0 if no such value.

Original entry on oeis.org

0, 0, 157, 1097, 10039, 100129, 1000039, 10000169, 100000543, 1000000097, 10000000277, 100000000237, 1000000001159, 10000000000853, 100000000001173, 1000000000000273, 10000000000000079, 100000000000001249
Offset: 1

Views

Author

Jonathan Vos Post, Nov 16 2009

Keywords

Comments

Least emirp (non-palindromic prime in A007500, i.e., prime whose reversal is a different prime) greater than 10^n, for which the sum of digits (A007953) is also an emirp.

Examples

			a(1) = a(2) = 0. a(3) = 157 because 157 is the least non-palindromic prime p > 10^3 such that R(p), in this case 751, is also prime, and the sum of digits sod(p), in this case 1+5+7 = 13, is likewise an emirp (prime with reversal a different prime). a(4) = 1097 because it is the smallest 4-digit prime, whose reversal (7901) is a different prime, and whose digital sum 1+0+9+7 = 17, which is prime and has a prime reversal (71).
		

Crossrefs

Programs

  • Maple
    read("transforms") ; A007953 := proc(n) local d ; add(d, d=convert(n,base,10)) ; end proc: isA006567 := proc(p) if isprime(p) then isprime(digrev(p)) and digrev(p) <> p ; else false ; end if; end proc ; A167992 := proc(n) local p; p := nextprime(10^(n-1)) ; while p <= 10^n do if isA006567(p) and isA006567(A007953(p)) then return p; end if; p := nextprime(p) ; end do ; return 0 ; end proc: seq(A167992(n),n=1..70) ; # R. J. Mathar, Nov 18 2009

Formula

a(n) = Min{p > 10^n in A006567, and A007953(p) is in A006567} = Min{p > 10^n in A000040 such that A004086(p) is in A000040, and A004086(p) distinct from p, and in A006567(p) is in A000040, and A004086(p) distinct from A006567(p), and in A000040}.

Extensions

More terms from R. J. Mathar, Nov 18 2009

A168159 Distance of the least reversible n-digit prime from 10^(n-1).

Original entry on oeis.org

1, 1, 1, 9, 7, 49, 33, 169, 7, 7, 207, 237, 91, 313, 261, 273, 79, 49, 2901, 51, 441, 193, 9, 531, 289, 1141, 67, 909, 331, 753, 2613, 657, 49, 4459, 603, 1531, 849, 2049, 259, 649, 2119, 1483, 63, 6747, 519, 3133, 937, 1159, 1999, 6921, 2949, 613, 4137, 1977, 31
Offset: 1

Views

Author

M. F. Hasler, Nov 21 2009

Keywords

Comments

A (much) more compact form of A114018 (cf. formula). Since this sequence and A114018 refer to "reversible primes" (A007500), while A122490 seems to use "emirps" (A006567), a(n+1) differs from A122490(n) iff 10^n+1 is prime <=> a(n+1)=1 <=> A114018(n)=10^n+1.

Programs

  • Mathematica
    Table[p = NextPrime[y = 10^(n - 1)]; While[! PrimeQ[FromDigits[Reverse[IntegerDigits[p]]]], p = NextPrime[p]]; p - y, {n, 55}] (* Jayanta Basu, Aug 09 2013 *)
  • PARI
    for(x=1,1e99, until( isprime(x=nextprime(x+1)) & isprime(eval(concat(vecextract(Vec(Str(x)),"-1..1")))),);print1(x-10^ (#Str(x)-1),", "); x=10^#Str(x)-1)
    
  • Python
    from sympy import isprime
    def c(n): return isprime(n) and isprime(int(str(n)[::-1]))
    def a(n): return next(p-10**(n-1) for p in range(10**(n-1), 10**n) if c(p))
    print([a(n) for n in range(1, 56)]) # Michael S. Branicky, Jun 27 2022

Formula

a(n)=A114018(n)-10^(n-1)
Previous Showing 51-60 of 89 results. Next