login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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.
1

%I #17 May 11 2021 09:05:12

%S 23,29,313,397,431,661,941,1129,1193,1223,1277,1613,2621,2791,3461,

%T 4111,4159,12641,12911,14419,15271,19211,21611,21773,22613,26731,

%U 29819,31181,31511,41381,61211,74611,111191,115811,121181,121727,141161,141221,141269,145513,157523,171713,173141,173891

%N 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.

%C Since p mod 0 is not defined, the digit 0 is not allowed.

%H Robert Israel, <a href="/A344127/b344127.txt">Table of n, a(n) for n = 1..1000</a>

%e 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.

%p filter:= proc(p) local L,s,t,q;

%p L:= convert(p,base,10);

%p s:= convert(L,`+`);

%p t:= convert(L,`*`);

%p if t = 0 then return false fi;

%p q:= p mod s;

%p isprime(q) and (p mod t) = nextprime(q)

%p end proc:

%p select(filter, [seq(ithprime(i),i=1..20000)]);

%o (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

%Y Cf. A007605, A053666, A136251.

%K nonn,base

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, May 09 2021