login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A167216 Primes whose reversal - 1 is also prime. 3
3, 23, 41, 47, 83, 89, 233, 251, 257, 281, 401, 461, 491, 809, 821, 827, 839, 857, 863, 887, 2003, 2069, 2081, 2099, 2153, 2213, 2237, 2267, 2333, 2351, 2381, 2393, 2399, 2477, 2591, 2633, 2657, 2711, 2741, 2753, 2789, 2819, 2879, 2909, 2939, 2957, 2963 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..1000

EXAMPLE

23 is in the sequence because 23 is prime and 32 - 1 = 31 is prime.

MAPLE

reverse:= proc(n)

local L, j;

L:= convert(n, base, 10);

add(L[j]*10^(nops(L)-j), j=1..nops(L))

end proc:

select(n -> isprime(n) and isprime(reverse(n)-1), [$1..10000]); # Robert Israel, Jul 11 2014

MATHEMATICA

Select[Prime[Range[5000]], PrimeQ[FromDigits[Reverse[IntegerDigits[#]]] - 1] &] (* Vincenzo Librandi, Jul 11 2014 *)

PROG

(MAGMA) [p: p in PrimesInInterval(2, 3000) | IsPrime(q-1) where q is Seqint(Reverse(Intseq(p)))]; // Vincenzo Librandi, Jul 11 2014

(Python)

from sympy import isprime, primerange

def ok(p): return isprime(int(str(p)[::-1]) - 1)

print([p for p in primerange(1, 3000) if ok(p)]) # Michael S. Branicky, Mar 23 2021

(PARI) isok(p) = isprime(p) && isprime(fromdigits(Vecrev(digits(p)))-1); \\ Michel Marcus, Mar 23 2021

CROSSREFS

Cf. similar sequences listed in A243457.

Sequence in context: A116893 A106066 A281551 * A309935 A212396 A319976

Adjacent sequences:  A167213 A167214 A167215 * A167217 A167218 A167219

KEYWORD

nonn,base

AUTHOR

Claudio Meller, Oct 30 2009

EXTENSIONS

Comment changed to an Example by Robert Israel, Jul 11 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 19 00:22 EDT 2021. Contains 347549 sequences. (Running on oeis4.)