A344127 Primes p such that (p mod s) and (p mod t) are consecutive primes, where s is the sum of the digits of p and t is the product of the digits of p.
23, 29, 313, 397, 431, 661, 941, 1129, 1193, 1223, 1277, 1613, 2621, 2791, 3461, 4111, 4159, 12641, 12911, 14419, 15271, 19211, 21611, 21773, 22613, 26731, 29819, 31181, 31511, 41381, 61211, 74611, 111191, 115811, 121181, 121727, 141161, 141221, 141269, 145513, 157523, 171713, 173141, 173891
Offset: 1
Examples
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..1000
Programs
-
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)]);
-
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
Comments