login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A114019 Largest n-digit prime whose digit reversal is also prime. 4

%I #12 Jun 28 2022 15:27:51

%S 7,97,991,9967,99989,999983,9999971,99999827,999999893,9999999967,

%T 99999999977,999999999959,9999999999799,99999999999959,

%U 999999999999877,9999999999999571,99999999999997997,999999999999999737,9999999999999999719,99999999999999999631

%N Largest n-digit prime whose digit reversal is also prime.

%H Michael S. Branicky, <a href="/A114019/b114019.txt">Table of n, a(n) for n = 1..527</a>

%t f[n_] := Block[{k = 10^n}, While[ !PrimeQ[k] || !PrimeQ[FromDigits@Reverse@IntegerDigits@k], k-- ]; k]; Array[f, 19] (* _Robert G. Wilson v_, Nov 19 2005 *)

%o (Python)

%o from sympy import isprime

%o def c(n): return isprime(n) and isprime(int(str(n)[::-1]))

%o def a(n): return next(p for p in range(10**n-1, 10**(n-1), -2) if c(p))

%o print([a(n) for n in range(1, 21)]) # _Michael S. Branicky_, Jun 27 2022

%Y Cf. A113018.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Nov 12 2005

%E More terms from _Robert G. Wilson v_, Nov 19 2005

%E a(19) and beyond from _Michael S. Branicky_, Jun 27 2022

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)