login

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”).

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
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
EXAMPLE
a(5)=99939 is included as 99929, 998939, 98939 and 89939 are primes.
PROG
(PARI) A124113(d)={
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
Sequence in context: A135219 A108904 A182672 * A223157 A223155 A308466
KEYWORD
hard,nonn,base
AUTHOR
Anton Vrba (antonvrba(AT)yahoo.com), Nov 29 2006
EXTENSIONS
a(2) corrected, a(7) inserted, and a(11)-a(12) added by Charles R Greathouse IV, Nov 15 2010
a(13) added by Charles R Greathouse IV, Nov 17 2010
STATUS
approved