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.

A380997 a(n) is the least number with exactly 2 different decimal digits that is a multiple of n.

Original entry on oeis.org

10, 10, 12, 12, 10, 12, 14, 16, 18, 10, 110, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 110, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 330, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 220, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 110, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 330, 67, 68, 69, 70, 71, 72, 73
Offset: 1

Views

Author

Robert Israel, Feb 11 2025

Keywords

Comments

a(n) is the least multiple of n that is in A031955.

Examples

			a(22) = 110 because 110 has two different decimal digits 0 and 1, is a multiple of 22, and no smaller multiple of 22 works.
		

Crossrefs

Cf. A031955.

Programs

  • Maple
    f:= proc(n) local d,i,s,S;
           S:= select(t -> nops(convert(convert(t*n mod 100,base,10),set)) <= 2, [$1..99] );
           for d from 3 do
             S:= select(s -> nops(convert(convert(s*n mod 10^d,base,10),set)) <= 2,
                   [seq(seq(s+i*10^(d-1),s = S),i=0..9)]);
             for s in S do if nops(convert(convert(s*n,base,10),set)) = 2  then return s*n fi od;
           od;
    end proc:
    map(f, [$1..1000]);
  • Mathematica
    a[n_]:=Module[{k=n}, While[Length[DeleteDuplicates[IntegerDigits[k]]]!=2, k+=n]; k]; Array[a,73] (* Stefano Spezia, Feb 13 2025 *)
  • PARI
    a(n) = my(k=n); while(#Set(digits(k)) != 2, k+=n); k; \\ Michel Marcus, Feb 13 2025