+ 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 :)

17th Sep 2017, 7:40 PM
Luca
Luca - avatar
45 Answers
+ 6
Minimal, Simple and Efficient Python code in 3 lines. https://code.sololearn.com/cT8jhmDK0Eb8/?ref=app
19th Sep 2017, 5:59 AM
Rahul Goswami
Rahul Goswami - avatar
+ 13
https://code.sololearn.com/c2EkEYny810p/?ref=app
18th Sep 2017, 4:56 PM
The Mir-acle
The Mir-acle - avatar
+ 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
18th Sep 2017, 2:54 AM
Zephyr Koo
Zephyr Koo - avatar
19th Sep 2017, 7:54 AM
David Akhihiero
David Akhihiero - avatar
17th Sep 2017, 9:19 PM
m abrate
m abrate - avatar
+ 10
https://code.sololearn.com/ceyKiNm3SRw2/#java Solution in java.
18th Sep 2017, 11:27 PM
Vukan
Vukan - avatar
+ 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
17th Sep 2017, 8:48 PM
Nick
Nick - avatar
+ 7
Here you go. Checks for valid input. Optimized algorithm for getting divisor count https://code.sololearn.com/c36z99fzd73V/?ref=app
18th Sep 2017, 8:27 AM
Vari93
Vari93 - avatar
+ 7
@Sergey Antonyuk I think there's something wrong with your code... factorizable is not refactorable..
21st Sep 2017, 2:24 PM
m abrate
m abrate - avatar
17th Sep 2017, 8:36 PM
3xhaust
3xhaust - avatar
+ 6
I made a checker and then tried making a number list but I messed something up in the process
18th Sep 2017, 4:30 AM
Nick
Nick - avatar
18th Sep 2017, 5:52 PM
Ferhat Sevim
Ferhat Sevim - avatar
+ 6
@Ferhat i like that your code provides divisors' list!
18th Sep 2017, 6:04 PM
Luca
Luca - avatar
+ 6
Thanks for challenge :) Here's my try... https://code.sololearn.com/Wo2pxd4ISmDX/?ref=app
19th Sep 2017, 10:08 AM
LukArToDo
LukArToDo - avatar
5th Oct 2017, 10:24 AM
Abhishek Tandon
Abhishek Tandon - avatar
17th Sep 2017, 9:24 PM
André
André - avatar
18th Sep 2017, 8:12 AM
Zizibee
+ 5
@Jhoniel your code seems to output also non-refactorable numbers... please have a look :)
18th Sep 2017, 12:16 PM
Luca
Luca - avatar
18th Sep 2017, 4:47 PM
Rabee Abbas
Rabee Abbas - avatar
+ 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.
18th Sep 2017, 6:57 PM
Ferhat Sevim
Ferhat Sevim - avatar