OFFSET
1,1
COMMENTS
For n > 1, a(n) ends in 1 or 9 while other digits can be 0,1,4,6,8 or 9. - Robert Israel, Dec 09 2017
LINKS
Robert Israel, Table of n, a(n) for n = 1..999
EXAMPLE
a(3) = 149 is a term as 1,4,9,14,49 are all nonprimes. 199 is not a member as 19 is a prime.
MAPLE
N:= 1000: # to get terms until the first where a(n) > 10^(n-1)+10*N+9
filter1:= proc(x)
local k, j;
for k from 0 to ilog10(x) do
for j from k to ilog10(x)+1 do
if isprime(floor((x mod 10^j)/10^k)) then return false fi;
od od:
true
end proc:
X:= select(filter1, [seq(seq(10*i+j, j=[1, 9]), i=0..N)]):
filter2:= proc(p, x)
local k, j;
if not isprime(p) then return false fi;
for k from 1 to ilog10(x)+1 do
if isprime(floor(p /10^k)) then return false fi
od;
true;
end proc:
for n from 1 do
found:= false;
for x in X do
p:= 10^(n-1)+x;
if filter2(p, x) then A[n]:= p; found:= true; break fi;
od:
if not found then break fi
od:
seq(A[i], i=1..n-1); # Robert Israel, Dec 09 2017
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Nov 23 2003
EXTENSIONS
Corrected and extended by David Wasserman, Oct 12 2005
STATUS
approved