OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..1101
EXAMPLE
a(1)=69: 69^3 + 2 = 328511; reversing its digits gives 115823, which is distinct from 328511, and both are primes, so 328511 is an emirp.
MAPLE
with(StringTools):K := proc(n) local a, b; a :=(n^3+2): b:=parse(Reverse(convert((a), string))):if (isprime(a)and isprime(b) and a<>b) then RETURN (n) fi: end: seq(K(n), n=1..100000); # K. D. Bajpai, Jul 04 2013
with(StringTools):K:=proc()local n, a, b, c; c:=1; for n from 1 to 500000 do; a:= (n^3+2); b:=parse(Reverse(convert((a), string))); if isprime(a)and isprime(b)and a<>b then lprint(c, n); c:=c+1; fi; od; end: K(); # K. D. Bajpai, Jul 04 2013
MATHEMATICA
emirpQ[n_]:=Module[{idn=IntegerDigits[n^3+2], rev}, rev=Reverse[idn]; idn != rev && And@@PrimeQ[FromDigits/@{idn, rev}]]; Select[Range[7500], emirpQ] (* Harvey P. Dale, Jul 04 2013 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Jul 04 2013
STATUS
approved