This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A378775 #19 Feb 09 2025 13:35:49 %S A378775 2,3,5,7,11,43,211,433,443,877,887,2111,2221,3221,5443,8887,9887, %T A378775 22111,33211,43321,54443,65543,76543,98887,99877,322111,332221,443221, %U A378775 444443,766543,888887,988877,2221111,3221111,3222211,3222221,3333221,4322221,4433333,4443221 %N A378775 Prime numbers with monotonically decreasing digits, differing by at most 1. %H A378775 Robert Israel, <a href="/A378775/b378775.txt">Table of n, a(n) for n = 1..10000</a> %e A378775 211 is a term since 211 is a prime number, the digits of 211 are monotonically decreasing, and the difference between consecutive digits is at most 1. %p A378775 extend:= proc(x) local d,s,i; %p A378775 d:= ilog10(x); %p A378775 s:= floor(x/10^d); %p A378775 seq(10^(d+1)*i+x, i=s .. min(9,s+1)) %p A378775 end proc: %p A378775 R:= 2,3,5,7: count:= 4: %p A378775 M:= [1,3,7,9]; %p A378775 for d from 2 while count < 100 do %p A378775 M:= map(extend,M): %p A378775 S:= sort(select(isprime,M)); %p A378775 count:= count+nops(S); %p A378775 R:= R,op(S); %p A378775 od: %p A378775 R; # _Robert Israel_, Feb 09 2025 %t A378775 Select[Prime[Range[312218]],ContainsOnly[Drop[IntegerDigits[#],-1]-Rest[IntegerDigits[#]],{0,1}]&] (* _James C. McMahon_, Dec 21 2024 *) %o A378775 (PARI) isok(p) = if (isprime(p), my(d=digits(p), dd = vector(#d-1, k, d[k+1]-d[k])); (#dd==0) || ((vecmin(dd)>=-1) && (vecmax(dd)<=0))); \\ _Michel Marcus_, Dec 09 2024 %Y A378775 Primes in A378808. %Y A378775 Cf. A378774, A028864. %K A378775 nonn,base,look %O A378775 1,1 %A A378775 _Randy L. Ekl_, Dec 06 2024