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

A112889
a(n) is the least nonnegative integer in base 10 containing n zeros that is divisible by n.
20
0, 100, 3000, 10000, 100000, 3000000, 70000000, 100000000, 9000000000, 10000000000, 1000000000010, 3000000000000, 100000000000004, 700000000000000, 3000000000000000, 10000000000000000, 1000000000000000002, 9000000000000000000, 100000000000000000090
OFFSET
1,2
LINKS
FORMULA
a(n) = n*A112890(n).
EXAMPLE
a(3) = 3000 because 3000 contains 3 zeros and is divisible by 3.
MAPLE
f:= proc(n) local d, x, y, z, d2, v;
for x from 1 to 9 do if x*10^n mod n = 0 then return x*10^n fi od;
for y from 1 to 9 do
for d from 0 to n do
for x from 1 to 9 do
v:= y*10^(n+1) + x*10^d;
if v mod n = 0 then return v fi;
od od od;
for z from 1 to 9 do
for d from 2 to n+1 do
for y from 1 to 9 do
for d2 from 0 to d-1 do
for x from 1 to 9 do
v:= z*10^(n+2) + y*10^d + x*10^d2;
if v mod n = 0 then return v fi;
od od od od od;
FAIL
end proc:
f(1):= 0:
map(f, [$1..50]); # Robert Israel, Jul 10 2023
KEYWORD
base,nonn
AUTHOR
Ray G. Opao, Oct 05 2005
EXTENSIONS
Extended by Ray Chandler, Oct 09 2005
STATUS
approved