OFFSET
1,1
COMMENTS
If m is a term, then 10*m is another term. - Bernard Schott, Nov 20 2021
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..11018 (all terms < 10**5)
EXAMPLE
The number 70 in reverse is 07 = 7, which is prime.
MAPLE
q:= n-> (s-> isprime(parse(cat(s[-i]$i=1..length(s)))))(""||n):
select(q, [$1..200])[]; # Alois P. Heinz, Aug 22 2021
MATHEMATICA
Select[Range[200], PrimeQ[FromDigits[Reverse[IntegerDigits[#]]]] &] (* Harvey P. Dale, Jun 13 2013 *)
PROG
(PARI) r(n) = for(x=1, n, y=eval(rev(x)); if(isprime(y), print1(x", "))) \ Get the reverse of the input string rev(str) = { local(tmp, j, s); tmp = Vec(Str(str)); s=""; forstep(j=length(tmp), 1, -1, s=concat(s, tmp[j])); return(s) }
(PARI) is_A095179(n)=isprime(eval(Strchr(vecextract(Vec(Vecsmall(Str(n))), "-1..1")))) \\ M. F. Hasler, Jan 13 2012
(PARI) isok(n) = isprime(fromdigits(Vecrev(digits(n)))); \\ Michel Marcus, Aug 22 2021
(Python)
from sympy import isprime
def ok(n): return isprime(int(str(n)[::-1]))
print(list(filter(ok, range(1, 173)))) # Michael S. Branicky, Aug 22 2021
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Cino Hilliard, Jun 21 2004
EXTENSIONS
Offset corrected to 1 by Alonso del Arte, Apr 12 2020
STATUS
approved