[Question]
  [
**This question already has answers here**:
 
 
[Find a multiple of a given number whose decimal representation looks like binary](/questions/60942/find-a-multiple-of-a-given-number-whose-decimal-representation-looks-like-binary)
 (44 answers)
 
Closed 6 months ago.
A *binary multiple* of a positive integer `k` is a positive integer `n` such that `n` is written only with `0`s and `1`s in base 10 and `n` is a multiple of `k`. For example, `111111` is a *binary multiple* of 3.
It is easy to show that a positive integer has infinitely many *binary multiples*. See [here](https://mathspp.com/blog/binary-multiples) for a construction proof of one *binary multiple* for each `k`. Multiplying by powers of `10` you get infinitely many more.
# Your task
Given a positive integer `k`, return the smallest binary multiple of `k`.
# Input
A positive integer `k`.
# Output
A positive integer `n`, the smallest binary multiple of `k`.
# Test cases
```
2 -> 10
3 -> 111
4 -> 100
5 -> 10
6 -> 1110
7 -> 1001
8 -> 1000
9 -> 111111111
10 -> 10
11 -> 11
12 -> 11100
13 -> 1001
14 -> 10010
15 -> 1110
16 -> 10000
17 -> 11101
18 -> 1111111110
19 -> 11001
20 -> 100
100 -> 100
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest submission in bytes, wins! If you liked this challenge, consider upvoting it... And happy golfing!
---
This is the first challenge of the [RGS Golfing Showdown](https://codegolf.meta.stackexchange.com/q/18545/75323). If you want to participate in the competition, you have 96 hours to submit your eligible answers. Remember there is 450 reputation in prizes! (See **6** of [the rules](https://codegolf.meta.stackexchange.com/q/18545/75323))
Otherwise, this is still a regular [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge, so enjoy!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
∞b.ΔIÖ
```
[Try it online!](https://tio.run/##yy9OTMpM/f//Uce8JL1zUzwPT/v/39ACAA "05AB1E – Try It Online") or [verify all test cases](https://tio.run/##yy9OTMpM/V9WeWilvZLCo7ZJCkr2/x91zEvSOzfl0LrD0/7X6vyPNtQx0jHWMdEx1THTMdex0LHUMTTQMTTUMTTSMTTWMTTRMTTVMTTTMTTXMbTQMbTUMQLKGhjEAgA) *(courtesy of @KevinCruijssen)*
---
## Explanation
```
∞b           - Infinite binary list
  .Δ         - Find the first value such that..
    IÖ       - It's divisible by the input
```
[Answer]
# [Python 2](https://docs.python.org/2/), 42 bytes
```
f=lambda k,n=0:n*(max(`n`)<'2')or f(k,n+k)
```
[Try it online!](https://tio.run/##JYxBCoMwEADvfcXezDZ7SHJqpL6kCEY0dkldJXior48BbzMMzH4e301cKbH7hXWcAiSSzrTyVGv4q0EGfDeuwS1DVDXphCVWYWCBHGSZlSOP@kZryL5Qf6wnV9GYvn0A7JnlAKZ6YCwX "Python 2 – Try It Online")
---
Full program, same length:
```
a=b=input()
while'1'<max(`b`):b+=a
print b
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P9E2yTYzr6C0REOTqzwjMydV3VDdJjexQiMhKUHTKknbNpGroCgzr0Qh6f9/YwA "Python 2 – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 10 bytes
```
`@YBUG\}HM
```
[Try it online!](https://tio.run/##y00syfn/P8Eh0inUPabWw/f/f0MLAA) Or [verify all test cases](https://tio.run/##LY1BC4JAFITv/YohEG9hHj1ZQcZS3YqigtZ1Q0F9y/MZeei3m5Vznfm@qbSU/SWMwgDzILgBHhbMugM9ILYRFLVrpZlM45N64R8PWyIHeloe6xlW5DqYltnWIwMhmLJwKWnOoPp7fF4e1PW92X0NexKLBEUDtq7UxmZIu2Gljn4EP83z38@auNICamUQ9h8).
### Explanation
```
`      % Do...while
  @    %   Push iteration index (1-based)
  YB   %   Convert to binary string (1 gvies '1', 2 gives '10,  etc).
  U    %   Convert string to number ('10' gives 10). This is the current
       %   solution candidate
  G    %   Push input
  \    %   Modulo. Gives 0 if the current candidate is a multiple of the
       %   input, which will cause the loop to exit
}      % Finally: execute on loop exit
  H    %   Push 2
  M    %   Push input to the second-last normal function (`U`); that is,
       %   the candidate that caused the loop to exit, in string form
       % End (implicit). If top of the stack is 0: the loop exits.
       % Otherwise: a new iteration is run
       % Display (implicit)
```
[Answer]
# JavaScript (ES6), 37 bytes
Looks for the smallest \$n\$ such that the decimal representation of \$p=n\times k\$ is made exclusively of \$0\$'s and \$1\$'s.
```
f=(k,p=k)=>/[2-9]/.test(p)?f(k,p+k):p
```
[Try it online!](https://tio.run/##Fcm7DoIwFAbg3afoZk/8LRzAG6Y4@QSOhqEB6gXTNtD4@hWnb/je5mvmbnqFuHW@H1KyWo4IeiTdZPdie2ozFYc5ykAX@5/NSHVI53uBEhV22OOAIzgHM7gAl@AKvAPvwQfwCcVSed6ulPXT1XRP6YRuROfd7D@D@viHdCr6W5xe7iFJBdPfopmiLElsxLoW6wUrHRGlHw "JavaScript (Node.js) – Try It Online") (some test cases removed because of recursion overflow)
---
# JavaScript (ES6), 41 bytes
Looks for the smallest \$n\$ such that \$k\$ divides the binary representation of \$n\$ parsed in base \$10\$.
```
k=>(g=n=>(s=n.toString(2))%k?g(n+1):s)(1)
```
[Try it online!](https://tio.run/##RY27DoJAFAV7v2Ibw95wJFyQp1ms/AJKY7HhJUJ2CWz8faSzOVNMMuejv3pr1nFxF2Pbbu/VPqlKDsocuykTOFu7dTSDjIjO032QxmcqN5JM@@0ZIcYVCVJkyFGAQzCDI3AMvoITcArOwDm4QHTYMHydgt6uD928pRGqEo01m527YLZH/P9HwaLb2unVyZiEL7xSeAd6aYho/wE "JavaScript (Node.js) – Try It Online") (all test cases)
[Answer]
# [PHP](https://php.net/), 38 bytes
```
while(($n=decbin(++$x))%$argn);echo$n;
```
[Try it online!](https://tio.run/##VVBbT8IwFH7fr/iyzGwLI1CQi85BSJRIQpQE38SYOStbgt1cOyQx/vbZrR1gX3rO@S7nksVZeTPN4swwLEG54AjwbAA9BBOQrifDfh0SUsWXqlzXByfKUFPqZKQ5tWCskxq50jT1qgrpnkwIUXAd9xpHBfXPPUkzhdYNzruTYdNRpaMGVNLxvxEURY@l3Xvdsx3ld8xefMPodFBdCVHIKUfBE7aFFeZbBod@Fck@3FEmIFKsn24XD5ogr4v23DU@0pyGUexAXzrkWis7WDnlxU7AxY9sS6M4VZgHE@0JTL/8jpMddRyLBe80ekuY02pZB9e9qGmuX0ks5pdabGIjNsL0YEn74Gg/hb2ardc2rmHPZ4ul7WF1v3q9e1z6sq3cTvKoAGX7JE/Zp1xGlgsma3LqA1wfgPFb/gE "PHP – Try It Online")
Counts up `n` in binary and divides it's decimal representation by `k` until there is no remainder; indicating the first, smallest multiple.
[Answer]
# [R](https://www.r-project.org/), ~~50~~ 38 bytes
-4 bytes thanks to Giuseppe.
```
grep("^[01]+$",(k=scan())*1:10^k)[1]*k
```
[Try it online!](https://tio.run/##K/r/P70otUBDKS7awDBWW0VJRyPbtjg5MU9DU1PL0MrQIC5bM9owViv7v9l/AA "R – Try It Online")
It follows from [this blog post](https://mathspp.com/blog/binary-multiples) (linked in the question) that the smallest binary multiple of \$k\$ is smaller than \$2\cdot10^{k-1}\$; this answer uses the larger bound \$k\cdot10^k\$ instead.
Creates a vector of all multiples of \$k\$ between \$k\$ and \$k\cdot10^k\$. The regexp gives the indices of those made only of 0s and 1s; select the first index and multiply by \$k\$ to get the answer.
Will time out on TIO for input greater than 8, but with infinite memory it would work for any input.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 19 bytes
```
≔1ηＷ﹪ＩηＩθ≔⍘⊕⍘η²¦²ηη
```
[Try it online!](https://tio.run/##S85ILErOT8z5/9@xuDgzPU9DyVBJRyFD05qrPCMzJ1VBwzc/pTQnX8M5sbhEI0NTRwHMKNTU1FSAanBKLE4NLinKzEvX8MxLLkrNTc0rSU1BFs7QUTDS1AQREJMDgKIgw6z//ze0/K9blgMA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
≔1η
```
Start at `1`.
```
Ｗ﹪ＩηＩθ
```
Repeat until a multiple of `n` is found, treating the values as base 10.
```
≔⍘⊕⍘η²¦²η
```
Convert from base 2, increment, then convert back to base 2.
```
η
```
Output the result.
[Answer]
# [Haskell](https://www.haskell.org/), ~~44 38~~ 36 bytes
Saved two bytes by using `filter` as suggested by @ovs.
```
f k=filter(all(<'2').show)[0,k..]!!1
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00h2zYtM6cktUgjMSdHw0bdSF1Trzgjv1wz2kAnW08vVlHR8H9uYmaebUFRZl6JgopCmoKh5X8A "Haskell – Try It Online")
This checks all multiples of `k` and is slow for input 9 and 18.
I much prefer this version which defines the list of all "binary" numbers and searches for the first multiple of `k` among them. It quickly handles all test cases, but needs 52 bytes:
```
b=1:[10*x+d|x<-b,d<-[0,1]]
f k=[m|m<-b,mod m k<1]!!0
```
[Try it online!](https://tio.run/##PYyxCsIwGIT3PsVVHNQ05Y@jJD6BTo4hSEqUSpqm2Iod@u4xOnjDx/EdXGtHf@u6lBolDlrQbmZumSVvKie5pkoYU9zhlQ5L@NoQHQK8FKYsKcW8DK/pMj1PPdYY2/iGB2NYgR8zcvu5Tb7YFsE@eii4iGCH8xURWtT1nkyBfyIEUfoA "Haskell – Try It Online")
[Answer]
# T-SQL, 57 bytes
This script is really slow when using 18 as input
```
DECLARE @z INT = 18
DECLARE @ int=1WHILE
@z*@ like'%[^10]%'SET @+=1PRINT @z*@
```
# T-SQL, 124 bytes
T-SQL doesn't have binary conversion
This will execute fast:
```
DECLARE @ int=1,@x char(64)=0,@a int=2WHILE 
@x%@z>0or @x=0SELECT
@x=left(concat(@%2,@x),@),@a-=1/~@,@=@/2-1/~@*-~@a
PRINT @x
```
**[Try it online](https://data.stackexchange.com/stackoverflow/query/1203060/rgs-1-5-binary-multiples)**
[Answer]
# [Bash](https://www.gnu.org/software/bash/) + Unix utilities, 52 bytes
```
for((n=1;n%$1;));do n=`dc<<<2dio1d$n+p`;done
echo $n
```
[Try it online!](https://tio.run/##S0oszvj/Py2/SEMjz9bQOk9VxdBaU9M6JV8hzzYhJdnGxsYoJTPfMEUlT7sgASicl8qVmpyRr6CS9///f0NzAA "Bash – Try It Online")
This counts in binary, views the resulting numbers in base 10, and stops when a multiple of the input is reached.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/),, ~~75~~\$\cdots\$ ~~50~~ 52 bytes
Saved 2 bytes thanks to [Mukundan](https://codegolf.stackexchange.com/users/91267/mukundan)!!!  
Added 2 bytes to fix error kindly pointed out by [Giuseppe](https://codegolf.stackexchange.com/users/67312/giuseppe). 
```
f=lambda k,n=1:(i:=int(f"{n:b}"))%k and f(k,n+1)or i
```
[Try it online!](https://tio.run/##TZDbaoQwEIbvfYrBpZCwKRjdgxXSyz5B70ovsuvIhl2jxAgW8dltDvaQq2/m@ycT0n/ZW6eLsjfr2oiHbC@1hDvTgldEVUJpS5p01tVlSSl9uoPUNTTEBfacdgbUasT8bkasUjmkDN7kY3CsOwuuXpLGZSxDUBpIQnLGM8oSUjDOuYeDa4TOcTMnbwKdGTgXUmXA0H1x@HN8zTPvAnGvAuUhFAd48XcPP0SO4hhTgU9xQyzOUfiRHeHlv43O73C6ItYDtHJS7diCwetoBtVpqLG3Nzcf3ritzMP74r3ZL9Mqgd5sf2sXeH6FuSGWLjCbDw9C4OcCOPV4tVindP0G "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~8~~ 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
‘¡DṀḊƊ¿
```
**[Try it online!](https://tio.run/##ARsA5P9qZWxsef//4oCYwqFE4bmA4biKxorCv////zY "Jelly – Try It Online")**
### How?
Note that in Jelly empty lists are falsey, while other lists are truthy. Also dequeue, `Ḋ`, is a monadic atom which removes the first item from a list, but when presented with only an integer Jelly will first convert that integer to a list by forming the range `[1..n]` thus `Ḋ` yields `[2..n]`.
```
‘¡DṀḊƊ¿ - Link: integer, k
      ¿ - while...
     Ɗ  - ...condition: last three links as a monad:
  D     -     decimal digits   e.g. 1410 -> [1,4,1,0]  or 1010 -> [1,0,1,0]
   Ṁ    -     maximum                       4                     1
    Ḋ   -     dequeue (implicit range of)   [2,3,4]               []
        -                                   (truthy)              (falsey)
 ¡      - ...do: repeat (k times):
‘       -     increment
```
For some reason, when the body of a while loop, `¿`, is a dyad each iteration sets the left argument to the result **and** then sets the right argument to the value of the left argument, so the 6 byte `+DṀḊƊ¿` does not work. (For example given `3` that would: test `3`; perform `3+3`; test `6`; perform `6+3`; test `9`; perform `9+6`; test `15`; perform `15+9`; etc...)
---
**[Previous 8](https://tio.run/##ARoA5f9qZWxsef//ROG4gsaRyKfhu43DsDEj////Ng):**
```
DḂƑȧọð1#
```
(`DḂƑ` could be `DỊẠ` too.)
**[An alternative](https://tio.run/##y0rNyan8/9/l4c4GbdWHu7sObzBU/v//vxkA "Jelly – Try It Online") 8**:
```
DṀ+%Ịð1#
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~11~~ ~~9~~ 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
È*nvU}a¤
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yCpudlV9YaQ&input=MTg)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 68 bytes
```
.+
$*1:1,1;
{`^(1+):\1+,(.+);
$2
T`d`10`.1*;
,0
,10
1+,(.+)
$1$*1,$1
```
[Try it online!](https://tio.run/##K0otycxL/P9fT5tLRcvQylDH0JqrOiFOw1Bb0yrGUFtHQ09b05pLxYgrJCElwdAgQc9Qy5pLx4BLx9CACyrNpWII1KqjYvj/v6ElAA "Retina 0.8.2 – Try It Online") Somewhat slow so no test suite. Explanation:
```
.+
$*1:1,1;
```
Initialise the work area with `n` in unary, `k` in unary, and `k` in decimal.
```
{`^(1+):\1+,(.+);
$2
```
If `n` divides `k` then delete everything except the result. This causes the remaining matches to fail and eventually the loop exits because it fails to achieve anything further.
```
T`d`10`.1*;
,0
,10
```
Treat `k` as a binary number and increment it.
```
1+,(.+)
$1$*1,$1
```
Regenerate the unary conversion of `k`.
[Answer]
# [Bash](https://www.gnu.org/software/bash/) + Core utilities, 40 bytes
```
seq $1 $1 $[10**$1]|grep ^[01]*$|head -1
```
[Try it online!](https://tio.run/##S0oszvj/vzi1UEHFEIyiDQ20tFQMY2vSi1ILFOKiDQxjtVRqMlITUxR0Df///28OAA "Bash – Try It Online")
[Answer]
# [W](https://github.com/A-ee/w), ~~7~~ 6 [bytes](https://github.com/A-ee/w/wiki/Code-Page)
-1 because I realized that W has operator overloading over `t`.
```
•B⌡≡kü
```
Uncompressed:
```
*Tt!iX*
```
[repl.it](https://repl.it/@wgolf/w) is quite slow and you need to type in the program in code.w.
## Explanation
```
        % For every number in the range
    i   % from 1 to infinity:
     X  % Find the first number that satisfies
*       %     Multiply the current item by the input
 T      %     The constant for 10
  t     %     Remove all digits of 1 and 0 in the current item
        %     Both operands are converted to a string, just like in 05AB1E.
   !    %     Negate - checks whether it contains only 1 and 0.
      * % Multiply that result with the input (because it's the counter value).
```
```
[Answer]
# Java 10, ~~62~~ ~~59~~ 58 bytes
```
n->{var r=n;for(;!(r+"").matches("[01]+");)r+=n;return r;}
```
[Try it online.](https://tio.run/##bU/LbsIwELzzFVOfbFlESY@46R@UC0fEwTUGTJMNWjuRKpRvT50Ublx29jE7mrnawa6vx5/JNTZGfNlA9xUQKHk@WeexnUeg6egMJxcgZfJuXOUSk03BYQtCjYnWn/fBMrgmc@pYmjfJWghVtDa5i49S7MvqoIUyinXmsE89E9iMk5nVbv13k9UeokMXjmizIblLHOi8P8Cqfzez@GIl1JVB@Kjfywxaq@UK7H5j8m3R9am45dfUkAxabCA0FU4GtQR4SRNVWT55uVWPqOP0Bw)
**Explanation:**
```
n->{             // Method with long as both parameter and return-type
  var r=n;       //  Result-long, starting at the input
  for(;!(r+"").matches("[01]+");)
                 //  Loop as long as `r` does NOT consists of only 0s and 1s
    r+=n;        //   Increase `r` by the input
  return r;}     //  After the loop is done, return `r` as result
```
This method above only works for binary outputs \$\leq1111111111111111111\$. For arbitrary large outputs - given enough time and resources - the following can be used instead (**~~99~~ ~~70~~ 64 bytes**):
```
n->{var r=n;for(;!(r+"").matches("[01]+");)r=r.add(n);return r;}
```
[Try it online.](https://tio.run/##jY89b4MwEIZ3fsXVky0rFnSsS4ZuHZoOGaMMVzDEFEx0GKQq4rfTI83I0OVO9/Xc@zY44a4pv5eixWGAD/ThlgD4EB1VWDg4rCVAw3umw3gxb75@52ntCAq52Q7K8s2ccBgiRl/AAQLksITd/jYhAeXBVj1J@yRJC6FWQnFxgxSnNDtroayinAyWpWQWuThSALLzYlfmdfxqmflAT70voWPZ8hjJh/p0BlR/mtcXbAR8nlnwr/lzyklrdR8CHH@G6DrTj9Fc@TK2QXotXkDoYLadmQnb0X1W0it197gJEVma/ovCew/OnMzLLw)
[Answer]
# [Perl 5](https://www.perl.org/), 21 +2 (-ap) = 23 bytes
```
$_+=$F[0]while/[^01]/
```
Run with `-a` and `-p`, input to stdin. Just keeps repeatedly adding the input for as long as the result contains anything other than digits 0 and 1.
[Try it online!](https://tio.run/##K0gtyjH9/18lXttWxS3aILY8IzMnVT86zsAwVv//f7N/@QUlmfl5xf91EwsA "Perl 5 – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~42~~ ~~40~~ 36 bytes
```
->k{z=k;z+=k until z.digits.max<2;z}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y67uso227pK2zZboTSvJDNHoUovJTM9s6RYLzexwsbIuqr2v4aRnp6RgaZeamJyRnVNZk1BaUmxgpJqsYKunYJqsZJqdKZOWnRmbGztfwA "Ruby – Try It Online")
Very slow for 18, but ultimately gets the job done.
4 bytes golfed down by G B.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 80 bytes
```
r,m,n;b(h){for(r=0,m=1;h;h/=2)r+=h%2*m,m*=10;h=r;}f(k){for(n=1;b(++n)%k;);b(n);}
```
This can probably be improved some but I have yet to find a way.
Converts the integer into binary and checks if it's a multiple.
Brute-force.
[Try it online!](https://tio.run/##XY/bbsIwDIbv8xQWU6WEmhF3RxTCi7BejJQuEWuK2rKLoT5759INbbNk@fTZ@u0Wb84NQ4MVRrOTXp3LupGN1VhZMt74pc1Uk1qfZPMKq7klbbxtTF/Kw8RG5nYyTaNKDkZxGpXph5sQ3fup2MO67YpQ3/qNECF2UL2GKD/qUChxFsA2NkM8nrp2m4O9tKbBaBnCHcI9wgPCI8ITwjPCCq9z0ghE7AwSk8QoMUsME9PEOK0QMv1757vojbjE8YlRhQML2nBYQxs@93UpJ11q@afc6lwxlabqn9hjw1dKOUsKWGwgKV7iDH9ecznC9YDLlTKTBNEPXw "C (gcc) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~50~~ 48 bytes
```
f=lambda k,n=0:n*({*str(n)}<={*"01"})or f(k,n+k)
```
[Try it online!](https://tio.run/##JY1BCsIwEADvfcUaL0kbIdGLFvMS8RCbrQ2t25JEUErfHgPeZmBglm8aZjrl3JvJvh7OwijJqJZqvtYxBU5iu5q1ZkqzTcwBel6CZhS5L@LBE0w@Jh4sPZFredRCNDet1L2twPel2Bm4gCX3R31uYZ8GjAidjRgBPx2ig4DdO0Q/Ezhc0gAVwBI8Je4lOzBZtl6I/AM "Python 3 – Try It Online")
## Explanation
* `n` represents the current multiple of `k`.
* `{*str(n)}<={*"01"}` checks if `n` only contains digits `0` or `1`. This is done by creating a set of characters of `n`, then checks if that set is a subset of \$\{0,1\}\$.
* `n*({*str(n)}<={*"01"}) or f(k,n+k)` is arranged such that the recursive call `f(k,n+k)` is only evaluated when `n` is 0 or `n` is not a binary multiple of `k`. Here multiplication acts as a logical `and`.
[Answer]
# [J](http://jsoftware.com/), 24 23 22 bytes
```
+^:(0<10#@-.~&":])^:_~
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/teOsNAxsDA2UHXT16tSUrGI146zi6/5rcqUmZ@QrGBoo2CqkKRhBeYaGYK4xTBIia4Ki1hSuFsI3gyuGaDaH8yHyFnD1EAAWtEQx0tAApgbCNURYAVVghGaJIcKJMDNM0NxlaIpwCFTEDKEEagzMsQiDLVH9bmSAygfSXH5OegqofoLKWXD9BwA "J – Try It Online")
Add the number to itself `+` while `^:...^:_` the following is true:
`(0<10#@-.~&":])` - Something other than the digits 0 and 1 appear in the stringified number.
[Answer]
# [Burlesque](https://github.com/FMNSSun/Burlesque), 13 bytes
```
rimo{>]2.<}fe
```
[Try it online!](https://tio.run/##DclLCoAgFAXQrdwVhPf5K4g2Ek0igyCJDGkgrt0607PmdIbnzqG9W2npiFeZFunGuodW49wEGgYWDh49qECCAmrQgBZ0oAcHyF9KfQ "Burlesque – Try It Online")
9 & 18 do work, but take a while because they're such large multiples. So I've taken them out of tests.
```
ri    # Read to int
mo    # Generate infinite list of multiples
{
 >]   # Largest digit
 2.<  # Less than 2
}fe   # Find the first element s.t.
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 49 bytes
```
(x=#;While[Or@@(#>1&)/@IntegerDigits@x,x=x+#];x)&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n277X6PCVtk6PCMzJzXav8jBQUPZzlBNU9/BM68kNT21yCUzPbOk2KFCp8K2Qls51rpCU@1/QFFmXomCQ3q0cez//wA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), 9 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
0ô+_▒╙2<▼
```
[Try it online.](https://tio.run/##DckxDkAwAIbR/buKpX@rLYm7iAUDsTiJRBP3MNrcpBcpb33rsM/TtoylmPeu@pyOfF62y@kpRVgcNZ5ApEEGCVnkUI08CiiiFvuXMR8) (Test cases `n=9` and `n=18` are excluded, since they time out.)
**Explanation:**
```
0          # Start with 0
        ▼  # Do-while false with pop,
 ô         # using the following 6 commands:
  +        #  Add the (implicit) input-integer to the current value
   _       #  Duplicate it
    ▒      #  Convert it to a list of digits
     ╙     #  Pop and push the maximum digit of this list
      2<   #  And check if this max digit is smaller than 2 (thus 0 or 1)
           # (after the do-while, the entire stack joined together is output implicitly)
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax/blob/master/docs/instructions.md), 9 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ü◘ø⌠Δ>0↔å
```
Port of [my MathGolf answer](https://codegolf.stackexchange.com/a/200033/52210). This is only my second Stax answer, so there might be a shorter alternative.
[Try it online](https://staxlang.xyz/#p=810800f4ff3e301d86&i=14) or [try it online unpacked (10 bytes)](https://staxlang.xyz/#c=0wx%2BcE%7CM1%3E&i=14).
**Explanation (of the unpacked version):**
```
0             # Start at 0
 w            # While true without popping, by using everything else as block:
  x+          #  Add the input-integer
    c         #  Duplicate the top of the stack
     E        #  Convert it to a list of digits
      |M      #  Get the maximum of this list
        1>    #  And check that it's larger than 1
              # (after the while, the top of the stack is output implicitly as result)
```
[Answer]
# [Red](http://www.red-lang.org), 52 bytes
```
func[n][i: 0 until[""= trim/with to""i: i + n"01"]i]
```
[Try it online!](https://tio.run/##DcnLCsIwEEDRvV9xma2ImT61oB/hNmQhfdCATiWk@PnRsz1pnspjnnw4LANl2W30FnwccOyW48uL3Mgpvs/fmFfyJvLPyBETpxJiKMuW5ue4YviKmoaWjp4L6lBFK7RGG7RFO7RHr1T/ci74T4qW8Yac7sKChVB@ "Red – Try It Online")
# [Red](http://www.red-lang.org), 54 bytes
```
func[n][i: 0 until[parse to""i: i + n[any["0"|"1"]]]i]
```
[Try it online!](https://tio.run/##Dck9CsMwDAbQvaf40FoKlvPXZughugoNJrGpoSjBSYZC7@5mfa/Eub7iLHpJI2o6bBJTySMcDtvzR9ZQtoh9ITox4wqTYF8hRz9iUtWsNS0lhukNg3g0aNGhx4A72IEZ7MENuAV34B48gB/wZzmnspZsO8RAtychwVTrHw "Red – Try It Online")
[Answer]
# [Icon](https://github.com/gtownsend/icon), 50 bytes
```
procedure f(n)
i:=seq(n,n)&0=*(i--10)
return i
end
```
[Try it online!](https://tio.run/##TY09DsIwDIX3nMLqgGKUSA4jUrkLaozkAQdMCuL0xVWH8ran7/3I1HRZHtYmrrMx3KJikPP44mfUpHig8Rgl50IYjPtsChJY61/lfhWNGMDFb7YveL1Ab3AiqA0@Jp2jJBjyZUh@ILiFN1CIduTG4Tr/Aw "Icon – Try It Online")
`seq(n,n)` generates an "infinite" (seq operator doesn’t work with large integers) sequence starting at `n` with step `n`
`&`is conjunction - Icon evaluates the next expression and if it fails, than backtracks to the expression to its left - so generates the next integer.
`i--10` finds the difference of the string representation of `i` with the string `10` - Icon automatically casts number to strings when an operation on strings is used.
`*(1--10)` finds the length of the difference of `i` and `10` (which is a string)
`0=*(1--10)` - if the length is `0`, the number is composed only of 1's and 0's.
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~53~~ 49 bytes
turns out Max can cast chars to codes implicitly
I tried a recursive version, but it was longer. Can't think of a way to replace the loop with LINQ...
```
a=>{int r=a;while($"{r}".Max()>49)r+=a;return r;}
```
[Try it online!](https://tio.run/##Sy7WTS7O/O9Wmpdsk5lXogPEdgpuCrYK/xNt7aqBPIUi20Tr8ozMnFQNFaXqololPd/ECg1NOxNLzSJtoFRRaklpUZ5CkXXtf2uugCKgDg03DSNNTQTHGJljgswxReaYIXPMkTkWyBxDsNR/AA "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~9~~ 7 bytes
```
ḟoΛεd∫∞
```
[Try it online!](https://tio.run/##ARkA5v9odXNr///huJ9vzpvOtWTiiKviiJ7///8y "Husk – Try It Online")
-2 bytes from Leo.
]