OFFSET
1,3
COMMENTS
Either all digits are '1', or one of the digits can be a prime (2, 3, 5, 7).
The initial 0 is included by convention. (Some authors consider that the decimal expansion of 0 is the empty sum (0 has no digits) whence the product of digits is 1.)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
R:= 0:
for d from 1 to 6 do
t:= (10^d-1)/9;
R:= R, t, seq(seq(t + a*10^i, a=[1, 2, 4, 6]), i=0..d-1);
od:
R; # Robert Israel, Mar 05 2026
PROG
(PARI) select( is(n)={isprime(n=vecprod(digits(n)))||n==1}, [0..1999]) \\ In older PARI versions, vecprod=factorback.
(PARI) next_A307714(n, d)={if(n<3||Set(d=digits(n))==[1], n+1, fromdigits(apply(t->if(t<2, 1, t<7, nextprime(t+1), 11), d)))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Apr 23 2019
STATUS
approved
