The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.



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 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181060 a(n) is the smallest positive multiple of n whose decimal digits are all 0, 1 or 2. 12


%S 1,2,12,12,10,12,21,112,12222,10,11,12,221,112,120,112,102,12222,1102,

%T 20,21,22,1012,120,100,1222,21222,112,1102,120,2201,1120,1122,102,210,

%U 22212,111,1102,10101,120,11111,210,2021,220,122220,1012,1222,1200

%N a(n) is the smallest positive multiple of n whose decimal digits are all 0, 1 or 2.

%H David A. Corneth, <a href="/A181060/b181060.txt">Table of n, a(n) for n = 1..10000</a>

%H Inspired by Project Euler, Problem 303: <a href="http://projecteuler.net/index.php?section=problems&amp;id=303">Multiples with small digits</a>.

%e a(9)=12222 because 12222 is the smallest multiple of 9 whose decimal digits are all 0, 1 or 2.

%t 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 *)

%o (PARI) a(n) = my(k=1); while(vecmax(digits(k*n))>2, k++); k*n; \\ _Michel Marcus_, May 17 2020

%Y a(n)/n yields sequence A181061.

%K base,easy,nonn

%O 1,2

%A _Herman Beeksma_, Oct 01 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 7 21:40 EST 2021. Contains 349589 sequences. (Running on oeis4.)