Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Oct 17 2023 18:25:13
%S 2,3,5,7,37,59,61,73,83,151,373,383,727,1627,3727,4049,4051,4951,5051,
%T 5059,6151,15161,15959,16273,26161,26261,37273,40483,48383,61627,
%U 62627,72727,73727,73849,83737,84059,94049,94837,94849,94949,94951
%N Primes whose consecutive digits differ by 4 or 5.
%H Robert Israel, <a href="/A048416/b048416.txt">Table of n, a(n) for n = 1..10000</a>
%p extend:= proc(n) local d,x;
%p d:= n mod 10;
%p seq(10*n+x, x = select(t -> t >= 0 and t <= 9, [d-5,d-4,d+4,d+5]))
%p end proc:
%p R:= 2,3,5,7: count:= 4:
%p T:= [$1..9]:
%p for d from 2 while count < 100 do
%p T:= map(extend,T);
%p V:= select(isprime,T);
%p count:= count+nops(V);
%p R:= R, op(V);
%p od:
%p R; # _Robert Israel_, Oct 17 2023
%Y Cf. A048413-A048420.
%K nonn,base
%O 1,1
%A _Patrick De Geest_, Apr 15 1999