cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Herman Beeksma, Oct 01 2010

Keywords

Examples

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

Crossrefs

a(n)/n yields sequence A181061.

Programs

  • 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 *)
  • PARI
    a(n) = my(k=1); while(vecmax(digits(k*n))>2, k++); k*n; \\ Michel Marcus, May 17 2020