OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local d, a, i, S, R;
if n mod 5 = 0 then return -1 fi;
for d from ilog10(n)+1 do
a:= (10^d-1)/9;
S:= [seq(10^i, i=0..d-1)];
R:= select(t -> convert(t, `+`) + a mod n = 0, combinat:-powerset(S));
if R <> [] then return min(map(t -> convert(t, `+`)+a, R))/n fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Dec 26 2022
CROSSREFS
KEYWORD
AUTHOR
V. Raman, Sep 07 2012
STATUS
approved