+ 10
[challenge] find lowest number with devisor 225 and digits only 0 and 1. Beginners welcome just read thread.
Find the lowest number which - has 225 as devisor - has only digits 0 and 1 How does solution change, if exactly one digit 2 is allowed? How does the 2nd solution change, if additionally ONE digit 5 is allowed? Let user input a digit > 1 This digit is allowed exactly one time while 0 and 1 as much as needed. how is solution now? Have fun, all weapons are welcome, brain first (and maybe only)
24 ответов
+ 2
Then, after reading all the answers I can say that:
Given an input n = 2,...,9:
The answer for the smallest number divisible by 225 that contains only 0's and 1's as digits and only one digit n is made like this:
(9-n)*'1' + 'n' + '00' (concatenation of the digits)
except for n = 5 that the answer should be:
(9-n)*'1' + 'n' + '0'
Great challenge!
+ 13
Dilema :
What is output if users input is 9?
Output 1: 900, or
Output 2: 111111111900 ?
+ 13
I hope it works 😊
https://code.sololearn.com/cqP0bOe21LqJ/?ref=app
+ 10
Thanks Oma 😉
+ 6
the lowest (-:
+ 5
@Andrija thanks for answer,
On the first glance the answer cant be right:
225 = 25 *9
the result must have 25 and 9 as devisors.
With last digit 1 it cant be true.
----> additionally my answer should be a hint
+ 5
great chllng..oma
225=25*9
only 0 and 1
so number contains 00 as last 2 dig..
divisible by 9 means sum up to 9
so i think
int( '1' * 9 + '00' ) is an ans...
11111111100 only 0 and 1
1111111200 exactly 1 digit 2
1125 exactly one dig 2 nd 1 digit 5
+ 5
@sayan only numbers 2,3,4,5,6,7,8,9 for this challenge.
just analyze your solution.....
LOL great! very exciting!!!!
+ 4
@sayan .... and no other!
Now you can easily solve the last part and write the prog..
+ 4
@Vadim thats it! So prog is a nobrainer for you?
+ 3
11111111100 only 0 and 1
1111111200 exactly 1 digit 2
1125 exactly one dig 2 nd 1 digit 5
+ 3
for 15//1110,120
45//1111111110,111111120,1125
75//11100,1200
numbers with 5^m * 3^n are interesting here..
in case of 3 if we use 2 --- problem becomes easy..
if its 20(5^1*2^2)
for 4 its two 0 and for 5 also 00
so its 100
if we use 6
i.e. 5^m*6^n
means 5^m*2^n*3^s
suppose 450(25*9*2)
so its 00 at last for 25
this goes for 2 also
and 9 1's
same result...
11111111100
generalising..
5^m*3^n
(3*n) 1's (m) 0's
...guess im right..
+ 3
11 111 111 100/225 = 49 382 716
Simple arithmetic. If the number N is divided by 225, then it can end in 0 or 5. But 5 is excluded. Hence, it is divided into 10. It is divided by 225 and by 10 - is divided by 450. If we divide it by 10, then the result N1=N/10 is divided by 45. Repeating these arguments, we get the third number N2=N1/10, divided by 9. The smallest number of digits 0 and 1, which is divided by 9 is 111111111 (the sum of the digits is divided by 9). Then N2 = 111111111, and N = 11111111100.
With one digit 2 I replace the last 11 with 2:
1111111200
+ 3
@Lucas could'nt write a better summary
Thank you!
+ 3
@Pedro Not 255, but 225 needed !
+ 3
Well, I do not want to think a lot over this challenge.
Let my computer use brute force. It may take a while, though...
https://code.sololearn.com/c6d6xA5sPu1F/
+ 2
11100001?
+ 2
f...k
1125
+ 2
😂😂😂😉😉😉😉😉😉😉
+ 2
With 5 and 2: N is divided by 25 and by 9. It is 1125.