+ 24
Challenge: refactorable number
this time a quite simple challenge :) A "refactorable number" is a number n that is divisible by the count of it's divisors. For example, 18 is a refactorable number, because it's divisors are: 1, 2, 3, 6, 9 and 18 (6 divisors) and 18/6 is an integer. task: write a code that outputs all refactorable numbers from 1 to x (user input) in any language you want! good coding :)
45 Respuestas
+ 6
Minimal, Simple and Efficient Python code in 3 lines.
https://code.sololearn.com/cT8jhmDK0Eb8/?ref=app
+ 13
https://code.sololearn.com/c2EkEYny810p/?ref=app
+ 11
Here's my C# implementation ✌
I reused some of the code from previous challenge and it work pretty well. Enjoy!
https://code.sololearn.com/cxELlOpnEJgg/?ref=app
+ 11
+ 10
here's my code in Python! 🐍
https://code.sololearn.com/cGV0vXWOydMf/?ref=app
+ 10
https://code.sololearn.com/ceyKiNm3SRw2/#java
Solution in java.
+ 7
I was close to doing it but I somehow screwed up and now nothing works anymore and I don't get why and I am too annoyed and angry to continue or start it again so maybe tomorrow but not today
+ 7
Here you go. Checks for valid input. Optimized algorithm for getting divisor count
https://code.sololearn.com/c36z99fzd73V/?ref=app
+ 7
@Sergey Antonyuk I think there's something wrong with your code... factorizable is not refactorable..
+ 6
I made a checker and then tried making a number list but I messed something up in the process
+ 6
Here is my try
https://code.sololearn.com/cMBpt60oi2XP
+ 6
@Ferhat i like that your code provides divisors' list!
+ 6
Thanks for challenge :)
Here's my try...
https://code.sololearn.com/Wo2pxd4ISmDX/?ref=app
+ 6
Here's mine
https://code.sololearn.com/cukTsu1WXv7Q/?ref=app
+ 5
A quick attempt in Ruby:
https://code.sololearn.com/cKVY1OPjFPn8/?ref=app
+ 5
Here is my solution in python
https://code.sololearn.com/c0ovLQ5lbOeh/?ref=app
+ 5
@Jhoniel your code seems to output also non-refactorable numbers... please have a look :)
+ 5
@Luca here my try at Python. It is almost same.
https://code.sololearn.com/c75D3ecOHmWA/?ref=app
https://code.sololearn.com/cBG9CD5Hv0C7/?ref=app
Edit: I coded with while. It worked better.