OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
Inspired by Project Euler, Problem 303: Multiples with small digits.
EXAMPLE
a(9)=12222 because 12222 is the smallest multiple of 9 whose decimal digits are all 0, 1 or 2.
MATHEMATICA
With[{pms=Rest[Flatten[FromDigits/@Tuples[{0, 1, 2}, 6]]]}, Table[ SelectFirst[ pms, Divisible[ #, n]&], {n, 50}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 24 2017 *)
PROG
(PARI) a(n) = my(k=1); while(vecmax(digits(k*n))>2, k++); k*n; \\ Michel Marcus, May 17 2020
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Herman Beeksma, Oct 01 2010
STATUS
approved