OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
223 is a term since the digits of 223 are monotonically increasing, consecutive digits differ by at most 1, and 223 is prime.
MAPLE
extend:= proc(x) local d, s, i;
d:= ilog10(x);
s:= floor(x/10^d);
seq(10^(d+1)*i+x, i=max(1, s-1) .. s)
end proc:
R:= 2, 3, 5, 7: count:= 4:
M:= [1, 3, 7, 9];
for d from 2 while count < 100 do
M:= map(extend, M):
S:= sort(select(isprime, M));
count:= count+nops(S);
R:= R, op(S);
od:
R; # Robert Israel, Feb 09 2025
MATHEMATICA
Select[Prime[Range[319629]], ContainsOnly[Rest[IntegerDigits[#]]-Drop[IntegerDigits[#], -1], {0, 1}]&] (* James C. McMahon, Dec 21 2024 *)
PROG
(PARI) isok(p) = if (isprime(p), my(d=digits(p), dd = vector(#d-1, k, d[k+1]-d[k])); (#dd==0) || ((vecmin(dd)>=0) && (vecmax(dd)<=1))); \\ Michel Marcus, Dec 09 2024
CROSSREFS
KEYWORD
AUTHOR
Randy L. Ekl, Dec 06 2024
STATUS
approved
