*DAILY CHALLENGE* : Write a function that calculates and prints the n'th 'quix-number' to screen! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

*DAILY CHALLENGE* : Write a function that calculates and prints the n'th 'quix-number' to screen!

INFO: A quix-number is a positive int x. Convert x into binary b and octal o and interpret b and o as decimal numbers again. If b%o == 0 and b%x == 0 then x is a quix-number! EXAMPLE: x = 40 o = 50 b = 101000 b%o = 101000%50 = 0 b%x = 101000%40 = 0 ---> 40 is a quix-number! PLEASE DON'T USE BUILT-IN FUNCTIONS FOR BIN/OCT-CONVERSATION! WRITE YOUR OWN!!! https://www.sololearn.com/Discuss/2968640/?ref=app

24th Aug 2017, 9:24 AM
Julian Fechner
Julian Fechner - avatar
38 Answers
+ 2
Quix Number program: My submission Thanks for the challenge! https://code.sololearn.com/c4P38i5bD2JL/?ref=app
26th Aug 2017, 2:09 AM
Sangilivelu
Sangilivelu - avatar
24th Aug 2017, 1:13 PM
༼ つ ◕_◕ ༽つ
༼ つ ◕_◕ ༽つ - avatar
24th Aug 2017, 2:27 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
25th Aug 2017, 10:33 PM
David Akhihiero
David Akhihiero - avatar
+ 5
I wont do any.additionnal challenge until you reward the ones already there !
24th Aug 2017, 1:58 PM
VcC
VcC - avatar
+ 5
@Julian - automatic checker is a great idea, but it requires accurate definition of program's input and output, and you didn't define it accurately enough. For example, if one program outputs: 262144 and another program outputs: The 36th quix number is 262144 How do you tell which one is correct? (They are both correct...) Another issue is restrictions you make in the task that are not easy to automatically check. In this challenge, there is a requirement to implement bin/oct conversions using basic language without using builtin library functions. Having the automated checker verify this is a challenge of its own... I also think that code clarity is more important than efficiency in most cases, so judging only time is problematic. Also if your checker is not thorough enough it might not catch any bug. And also I doubt you can compare times with programs written in different languages. There are inherent performance differences between the languages, and I bet the Sololearn environments for the various languages are not all equal.. Bottom line, I think it's a good idea apply automated checker: 1) Need to define the program's output precisely. 2) The checker should only detect bugs to disqualify buggy programs 3) The judging should be done "manually" among those programs that passed the checker.
24th Aug 2017, 4:06 PM
Sivan Tal
Sivan Tal - avatar
+ 5
@Julian Then wouldnt C++ codes most likely always wins since they are proven to run ~10x faster than most average programming languages. You are not thinking about a realistic point of view. A good code is something which you yourself can read and understand. (And doesnt look bad).
25th Aug 2017, 8:21 AM
Wen Qin
Wen Qin - avatar
+ 4
I already have a base conversion fully working and can convert to any positive K bases properly. (Its written in F# btw) Im lazy to do a (b%o == 0) checking, so just going to leave the link to code here. https://github.com/Yeo-Wen-Qin/BaseConversions
24th Aug 2017, 7:02 PM
Wen Qin
Wen Qin - avatar
+ 3
@VcC I'm currently worling on an nice little test-script that runs all codes, times them, calculate avg exec time and output the winner. this will be an html page and i'll upload the link as soon as possible! give me a little more time ;) (maybee at the week-end)
24th Aug 2017, 3:27 PM
Julian Fechner
Julian Fechner - avatar
26th Aug 2017, 6:28 AM
m abrate
m abrate - avatar
+ 2
Could you look at the old challenges and elect winners, Julian Fechner?
24th Aug 2017, 3:32 PM
Timon Paßlick
25th Aug 2017, 3:05 PM
hmysjiang🍀
hmysjiang🍀 - avatar
+ 1
24th Aug 2017, 11:02 AM
sayan chandra
sayan chandra - avatar
24th Aug 2017, 11:49 AM
kamakshi
kamakshi - avatar
+ 1
Here's my solution in Python. So far it's the only solution that doesn't use int/str conversions. Works solely with numbers. https://code.sololearn.com/cdWTkDwbH9h6
24th Aug 2017, 11:52 AM
Sivan Tal
Sivan Tal - avatar
+ 1
@Timon, please refrain from making claims about everyone else ;-)
24th Aug 2017, 5:21 PM
Sivan Tal
Sivan Tal - avatar
+ 1
its ok Timon... thers millions of people thousands of challenges one after another.. how about taking them as a practice evalution of so much code is not possible...most of the time yours the credit if you can manage the right output while displaying..
24th Aug 2017, 5:31 PM
sayan chandra
sayan chandra - avatar
+ 1
i thought you could evaluate the codes of these 3 daily challenges in 1 to 2 hours. i posted my last comment because i didn't want that you think you must evaluate the last 20 challenges or something. i wanted the opposite of what came across. i didn't want to make claims or judge anybody, i'm graceful that you even do it in your free time.
24th Aug 2017, 7:58 PM
Timon Paßlick
25th Aug 2017, 10:48 AM
Petros Simidyan
Petros Simidyan - avatar
+ 1
Here you go. Checks for valid input. https://code.sololearn.com/cya2M8tLX1YY/?ref=app
19th Sep 2017, 2:55 AM
Vari93
Vari93 - avatar