login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(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. 9
1, 2, 12, 12, 10, 12, 21, 112, 12222, 10, 11, 12, 221, 112, 120, 112, 102, 12222, 1102, 20, 21, 22, 1012, 120, 100, 1222, 21222, 112, 1102, 120, 2201, 1120, 1122, 102, 210, 22212, 111, 1102, 10101, 120, 11111, 210, 2021, 220, 122220, 1012, 1222, 1200 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..48.

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) okd(n) = {d = digits(n); for (i = 1, #d, if ((d[i] != 0) && (d[i] != 1) && (d[i] != 2), return (0)); ); return (1); }

a(n) = {k = 1; while(! okd(k*n), k++); k*n; } \\ Michel Marcus, Aug 23 2013

CROSSREFS

a(n)/n yields sequence A181061.

Sequence in context: A245281 A308215 A216478 * A171446 A068515 A088240

Adjacent sequences:  A181057 A181058 A181059 * A181061 A181062 A181063

KEYWORD

base,easy,nonn

AUTHOR

Herman Beeksma, Oct 01 2010

STATUS

approved

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 September 16 02:16 EDT 2019. Contains 327088 sequences. (Running on oeis4.)