A125268 Numbers that end with decimal digit 1, 3, 7, or 9 and that produce only composite numbers when any of the digits 0,1,...,9 is inserted anywhere in them (including at the beginning or end).
25011, 52647, 72753, 122313, 168699, 283251, 324021, 598041, 783441, 804131, 837207, 924807, 1247241, 1905759, 2514819, 3461101, 3514077, 3617389, 3905817, 4112913, 4142139, 4203151, 4229871, 4283679, 4531907, 4628827, 4828443, 5380413, 5478091, 5632671, 5714889, 5818569, 5989269, 5990961
Offset: 1
Links
- Max Alekseyev, Table of n, a(n) for n = 1..972 (all terms below 10^8)
Programs
-
Maple
filter:= proc(n) local x,y,d,t; x:= n; y:= 0; for d from 0 to ilog10(n)+1 do for t from 0 to 9 do if isprime(10^(d+1)*x+10^d*t + y) then return false fi; od; t:= x mod 10; y:= y + 10^d*t; x:= (x-t)/10; od; true end proc: select(filter, [seq(seq(10*i+j,j=[1,3,7,9]),i=0..10^6)]); # Robert Israel, Sep 12 2016
-
PARI
{ printA125268(U=8) = my(v,t); v=vector(10^U); forprime(p=11,10^(U+1), if(p<=U,v[p]=p); for(i=1,#Str(p), t=(p\10^i) * 10^(i-1) + (p%10^(i-1)); if(#Str(t)==#Str(p)-1,v[t]=p););); forstep(n=1,10^U,2, if(n%10==5||v[n],next); print1(n,", ");); } \\ prints terms below 10^U, by Max Alekseyev, Sep 12 2016
Extensions
Corrected and extended by Robert G. Wilson v, Jan 26 2007
Removed incorrect terms and extended by Max Alekseyev, Sep 12 2016
Comments