[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A356947
Emirps p such that p == 1 (mod s) and R(p) == 1 (mod s), where R(p) is the digit reversal of p and s the sum of digits of p.
2
1021, 1031, 1201, 1259, 1301, 9521, 10253, 10711, 11071, 11161, 11243, 11701, 12113, 12241, 14221, 15907, 16111, 16481, 17011, 17491, 18461, 19471, 30757, 31121, 34211, 35201, 70951, 71347, 71569, 72337, 73327, 74317, 75703, 96517, 100621, 101611, 101701, 102061, 102913, 103141, 105211, 106661
OFFSET
1,1
COMMENTS
Emirps p such that p and its digit reversal are quasi-Niven numbers.
LINKS
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