What is the smallest positive multiple of 450 whose digits are all zeroes and ones?

What is the smallest positive multiple of 450 whose digits are all zeroes and ones?

I tried guess and check but the numbers grew big fast. Thanks in advance!


Can we agree that it must be an even multiple of 450? Otherwise the last two digits will be 50.

What is the smallest positive multiple of 900 such that all the digits are 0s or 1s?

A rule of multiples of 9: the sum of the digits of a multiple of 9 is a multiple of 9.

This rule goes both ways. If the sum of the digits is a multiple of 9, the number is a multiple of 9.

That makes 11111111100 our winner.


Write the answer N as $450k$. To ensure that the tens place is either one or zero, we require $k$ to be even. Therefore N is a multiple of 900. Because any multiple of 900 must have its last two digits zero, we can ignore the tens and units places and reduce the question to:

What is the smallest multiple of 9 with all digits 0 or 1?

A number is divisible by 9 if and only if the sum of its digits is a multiple of 9. But we are restricted to ones and zeros, so the smallest multiple of 9 that can be formed is nine ones: $111{,}111{,}111$.

Hence the answer to your question is this number with the two zeros tacked back on at the end: $$11{,}111{,}111{,}100=450\times24{,}691{,}358$$ (I have added grouping commas for clarity.)


A short Python script to solve this.

Input:

x=450

while 1:
    # Convert number to text string
    strX = str(x) 

    # Check if the number of 0's and 1's equal the total length of the string
    if strX.count("0") + strX.count("1") == len(strX):
        print "Found it:", strX
        break

    # Add another 450
    x=x+450

Output:

Found it: 11111111100

Here's another brute-force Python script, but it's rather more efficient than shiftypixlz's.

target = 450
i = 1
while True:
    n = int(format(i, 'b'))
    if n % target == 0:
        break
    i += 1

print(n, n // target)

output

11111111100 24691358

n = int(format(i, 'b')) first converts the integer i to a string of binary digits, but then interprets that string as a decimal integer.


one more way. let x be the required number.

for a number to be multiple of 450, it should be multiple of 10. so 10.y =x now y should be multiple of 45. it should be first multiple of 5. so a number with only 1, o will be multiple of 5 if last digit is 0. so y = 2. w/9...dividing 10 by 5 gives 2 in numerator.

2.w should be mulitple of 9 and should contain only 1,0.

using the fact that sum of digits should be multiple of 9 for a number to be multiple of 9,

2.w should be 111111111.

adding two zeros extra. 11111111100.

thus 11111111100 is the required number.

lengthy process but easy to understand.