OFFSET
1,1
COMMENTS
Does a(n) exist for all n? - David A. Corneth, Apr 22 2026
LINKS
David A. Corneth, PARI program
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
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
