login
A220490
The largest n-digit number whose last k digits are divisible by k for k = 1..n.
1
9, 98, 996, 9996, 99960, 999960, 9999780, 99999360, 999999360, 9999999360, 99999951480, 999999951480, 9999999729720, 99999693990000, 999999693990000, 9999999693990000, 99999999063360000, 999999999063360000, 9999999936135855360, 99999999936135855360, 999999798363798870960
OFFSET
1,1
COMMENTS
Does a(n) exist for all n? - David A. Corneth, Apr 22 2026
EXAMPLE
There are ten one-digit numbers divisible by 1 and the largest is 9 so a(1)=9.
For two-digit numbers, the ones digit must make it divisible by 2, which gives 98 as the largest to satisfy the requirement. So a(2)=98.
MAPLE
f:= proc(n) local a, q, k, j;
if n >= 5 then q:= ilcm(10, n) elif n >= 2 then q:= ilcm(n, 2) else q:= n fi;
if 10^n mod q = 0 then a:= 10^n - q else a:= floor(10^n/q)*q fi;
for k from a by -q do
if andmap(i -> (k mod 10^i) mod i = 0, [$2..n]) then return k fi
od
end proc:
map(f, [$1..17]); # Robert Israel, Apr 22 2026
PROG
(PARI) \\ See Corneth link
CROSSREFS
Cf. A164836.
Sequence in context: A057933 A064617 A225608 * A024115 A066557 A289214
KEYWORD
nonn,base
AUTHOR
Shyam Sunder Gupta, Aug 07 2013
EXTENSIONS
a(12)-a(17) from Robert Israel, Apr 22 2026
More terms from David A. Corneth, Apr 22 2026
STATUS
approved