cp's OEIS Frontend

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.

A378774 Prime numbers with monotonically increasing digits, increasing by only 0 or 1.

This page as a plain text file.
%I A378774 #19 Feb 09 2025 13:28:24
%S A378774 2,3,5,7,11,23,67,89,223,233,677,1123,1223,2333,4567,7789,8999,23333,
%T A378774 45667,45677,55667,67777,67789,77899,78889,112223,344567,445567,
%U A378774 555677,556789,566677,567899,666667,788999,1112333,2222333,3445567,3445667,3455567,3456667,4455667,4456789,4556777
%N A378774 Prime numbers with monotonically increasing digits, increasing by only 0 or 1.
%H A378774 Robert Israel, <a href="/A378774/b378774.txt">Table of n, a(n) for n = 1..10000</a>
%e A378774 223 is a term since the digits of 223 are monotonically increasing, consecutive digits differ by at most 1, and 223 is prime.
%p A378774 extend:= proc(x) local d,s,i;
%p A378774   d:= ilog10(x);
%p A378774   s:= floor(x/10^d);
%p A378774   seq(10^(d+1)*i+x, i=max(1,s-1) .. s)
%p A378774 end proc:
%p A378774 R:= 2,3,5,7: count:= 4:
%p A378774 M:= [1,3,7,9];
%p A378774 for d from 2 while count < 100 do
%p A378774   M:= map(extend,M):
%p A378774   S:= sort(select(isprime,M));
%p A378774   count:= count+nops(S);
%p A378774   R:= R,op(S);
%p A378774 od:
%p A378774 R; # _Robert Israel_, Feb 09 2025
%t A378774 Select[Prime[Range[319629]], ContainsOnly[Rest[IntegerDigits[#]]-Drop[IntegerDigits[#], -1], {0, 1}]&] (* _James C. McMahon_, Dec 21 2024 *)
%o A378774 (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
%Y A378774 Cf. A028864, A378775.
%K A378774 nonn,base,look
%O A378774 1,1
%A A378774 _Randy L. Ekl_, Dec 06 2024