|
|
A124113
|
|
a(n) = largest composite number of n decimal digits that becomes prime by decreasing any one of the higher-order digits.
|
|
1
|
|
|
99, 987, 9951, 99939, 996983, 9981153, 99745289, 981196517, 9927756573, 99243774623, 992617385333, 9751651447377
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
COMMENTS
|
a(n) == 0 (mod 7) for n > 6.
What is the first n for which a(n) does not exist? Rough heuristics suggest before 20. - Charles R Greathouse IV, Nov 18 2010
|
|
LINKS
|
|
|
EXAMPLE
|
a(5)=99939 is included as 99929, 998939, 98939 and 89939 are primes.
|
|
PROG
|
forstep(n=10^d-1, 10^d\9, [-2, -4, -2, -2],
if(isA124113(n, d), return(n))
)
};
isA124113(n, d)={
if(n%3==1, return(0));
for(i=1, d-1,
if(!isprime(n-10^i), return(0))
);
my(v=eval(Vec(Str(n))));
for(i=1, #v,
if(v[i]==0, return(0))
);
!isprime(n)
};
|
|
CROSSREFS
|
|
|
KEYWORD
|
hard,nonn,base
|
|
AUTHOR
|
Anton Vrba (antonvrba(AT)yahoo.com), Nov 29 2006
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|