login
A328326
Least multiple of n that contains only the distinct digits of n and n+1, with each of those digits appearing at least once.
1
12, 32, 3444, 544, 65, 7776, 8778, 9888, 10111111119, 10, 121, 132, 143, 154, 165, 176, 187, 198, 2109, 120, 21, 2332, 3243, 2544, 625, 22672, 22788, 9828, 20039, 11130, 23312, 32, 3434343, 33354, 5635, 367776, 37888, 8398, 344409, 1040, 2214, 3234, 43, 5544, 46665
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
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
Sequence in context: A192213 A050690 A079561 * A131543 A372026 A063296
KEYWORD
nonn,base
AUTHOR
Ali Sada, Dec 03 2019
EXTENSIONS
More terms from Giovanni Resta, Dec 10 2019
STATUS
approved