OFFSET
1,1
COMMENTS
Inspired by the problem 1/2 of International Mathematical Talent Search, round 2 (see link).
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
International Mathematical Talent Search, Problem 1/2, Round 2.
EXAMPLE
a(9) = 288 = 32 * 9 is the smallest multiple of 9 which contains only even digits.
MATHEMATICA
a[n_] := Module[{k = 2*n}, While[! AllTrue[IntegerDigits[k], EvenQ], k += n]; k]; Array[a, 60] (* Amiram Eldar, Jan 05 2022 *)
PROG
(Python)
def a(n):
m, inc = 2*n, n if n%2 == 0 else 2*n
while not set(str(m)) <= set("02468"): m += inc
return m
print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Jan 05 2022
(Python)
from itertools import count, product
def A350538(n):
for l in count(len(str(n))-1):
for a in '2468':
for b in product('02468', repeat=l):
k = int(a+''.join(b))
if k > n and k % n == 0:
return k # Chai Wah Wu, Jan 12 2022
(PARI) a(n) = my(k=2); while(#select(x->((x%2) == 1), digits(k*n)), k++); k*n; \\ Michel Marcus, Jan 12 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jan 05 2022
EXTENSIONS
More terms from Michael S. Branicky, Jan 05 2022
STATUS
approved