OFFSET
1,1
COMMENTS
From David J. Seal, Dec 13 2019: (Start)
There is always such a multiple of n. To prove this, note first that there is always a multiple m*n of n of the form 111...1000...0, which can be established by applying the 'pigeonhole principle' to the sequence 1 mod n, 11 mod n, 111 mod n, 1111 mod n, ... For any desired set of digits that includes 0, therefore, we can construct a multiple of n whose digit set is precisely that set and all of whose 0's appear at its end by adding together suitable multiples of m*n by the nonzero digits. For example, if we want a multiple of 592 whose digit set is precisely {0,2,3,5,9} and all of whose 0's appear at its end, we can first note that 592*1875 = 1110000 and then construct 2*1110000 + 3*1110000*1000 + 5*1110000*1000000 + 9*1110000*1000000000 = 9995553332220000.
That allows us to construct a multiple of n with the desired set of digits if n or n+1 includes a digit 0. If not, first construct a multiple m*n of n whose digit set is precisely 0 and the distinct digits of n and n+1 and all of whose 0's appear at its end as above, then concatenate enough copies of n to produce a multiple of n of length at least the number of 0's at its end. Then multiply m*n by a suitable power of 10 to make the number of 0's at its end equal to the length of that concatenated multiple, and add. For example, to construct a multiple of 592 whose digits are precisely {2,3,5,9}, first construct 9995553332220000 as above, then construct the concatenated multiple of length at least four digits, which is 592592, then construct 9995553332220000*100 + 592592 = 999555333222592592 = 592*1688438062876001.
Note that this is just a proof that such a multiple exists and therefore a(n) exists, not a construction of a(n). For example, the actual value of a(592) is 592*156 = 92352. (End)
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
143 is the least multiple of 13 that contains all the digits of 13 and 14, so a(13)=143.
MATHEMATICA
a[n_] := Block[{d = Union @@ IntegerDigits[{n, n + 1}], nd, k, pp, can, e, v, s}, k = nd = Length[d]; While[True, pp = Flatten[Permutations /@ IntegerPartitions[k, {nd}], 1]; can = Table[ Flatten[ ConstantArray @@@ Transpose[{d, p}]], {p, pp}]; v = Infinity; Do[s = SelectFirst[ Permutations[e], #[[1]] > 0 && Mod[ FromDigits[#], n] == 0 &, {}]; If[s != {}, v = Min[v, FromDigits[s]]], {e, can}]; If[v != Infinity, Break[], k++]]; v]; Array[a, 45] (* Giovanni Resta, Dec 10 2019 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ali Sada, Dec 03 2019
EXTENSIONS
More terms from Giovanni Resta, Dec 10 2019
STATUS
approved