OFFSET
1,1
COMMENTS
Emirps p such that p and its digit reversal are quasi-Niven numbers.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = 1201 is a term because it and its digit reversal 1021 are distinct primes with sum of digits 4, and 1201 == 1021 == 1 (mod 4).
MAPLE
filter:= proc(n) local L, i, r, s;
if not isprime(n) then return false fi;
L:= convert(n, base, 10);
r:= add(L[-i]*10^(i-1), i=1..nops(L));
if r = n or not isprime(r) then return false fi;
s:= convert(L, `+`);
n mod s = 1 and r mod s = 1
end proc:
select(filter, [seq(i, i=13 .. 200000, 2)]);
MATHEMATICA
Select[Range[110000], (r = IntegerReverse[#]) != # && PrimeQ[#] && PrimeQ[r] && Divisible[# - 1, (s = Plus @@ IntegerDigits[#])] && Divisible[r - 1, s] &] (* Amiram Eldar, Sep 06 2022 *)
PROG
(Python)
from sympy import isprime
def ok(n):
strn = str(n)
R, s = int(strn[::-1]), sum(map(int, strn))
return n != R and n%s == 1 and R%s == 1 and isprime(n) and isprime(R)
print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Sep 06 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Sep 05 2022
STATUS
approved