A216482 a(n) is the least value of k such that k*n uses only digits 1 and 2. a(n) = -1 if no such multiple exists.
1, 1, 4, 3, -1, 2, 3, 14, 1358, -1, 1, 1, 17, 8, -1, 7, 13, 679, 59, -1, 1, 1, 527, 88, -1, 47, 786, 4, 418, -1, 362, 66, 34, 33, -1, 617, 3, 319, 2849, -1, 271, 291, 284, 48, -1, 2657, 26, 44, 229, -1, 22, 406, 4, 393, -1, 2, 3723, 209, 19, -1, 2, 181, 194, 33, -1, 17, 33, 1634, 3219, -1, 172, 1696, 2907, 3, -1, 1462, 1443, 1554, 28, -1, 262, 271, 134, 1443
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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