OFFSET
1,1
COMMENTS
Since p mod 0 is not defined, the digit 0 is not allowed.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = 313 is a term because with s = 3+1+3 = 7 and t = 3*1*3 = 9, 313 mod 7 = 5 and 313 mod 9 = 7 are consecutive primes.
MAPLE
filter:= proc(p) local L, s, t, q;
L:= convert(p, base, 10);
s:= convert(L, `+`);
t:= convert(L, `*`);
if t = 0 then return false fi;
q:= p mod s;
isprime(q) and (p mod t) = nextprime(q)
end proc:
select(filter, [seq(ithprime(i), i=1..20000)]);
PROG
(PARI) isok(p) = if (isprime(p), my(d=digits(p)); vecmin(d) && isprime(q=(p%vecsum(d))) && isprime(r=(p%vecprod(d))) && (nextprime(q+1)==r)); \\ Michel Marcus, May 10 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, May 09 2021
STATUS
approved