Alright guys, here it is. The first of the programming contest in the coders lounge. This week, the theme is "Amicable Numbers" and the question you must provide a solution for is the following:
Originally Posted by Question
Find the sum of all the amicable numbers under 15000
Obviously you'll need to do some research on amicable numbers before hand. Don't even think about leeching code because I will do a thorough search of related solutions to make sure there is no leeching going on. I know Wes has a working solution already, as may a few people, but that's fine.
You have exactly 1 week to complete a solution. Upon completing your solution, you must send me a PM with a pastebin link to your code and the title being: "Programming Contest #1:" followed by the answer. I'll keep tabs on who delivers their solutions first (note, as there are multiple people in different timezones, each entry will be classified into the 'day' it was released (i.e, day one, day two...etc) Points will be awarded for an elegant, efficient and original solution
So, you have your question, you have a week to complete it. Let's see some fucking sexy code. This question may seem a little bit like "wtf" at first, but I assure you it's pretty easy. I decided to keep the first one relatively simple, because I don't want to discourage people so early on in the contests.
Have at it!
I'll be coding mine in PHP
Posts 1–15 of 19 · Page 1 of 2
Post a Reply
Tags for this Thread
None
I solved about an hour ago, but improved it a bit =3 1297 msec was fastest I clocked it at.
Good luck everyone
I've got my algorithm ... But I'm on my way to school T.T
By the time I get home + doctor it'll be like day 2 :/
Originally Posted by freedompeace
I've got my algorithm ... But I'm on my way to school T.T
By the time I get home + doctor it'll be like day 2 :/
You're in australia too... You have like 18 hours til day 2 lol.
Originally Posted by Jason
You're in australia too... You have like 18 hours til day 2 lol.
I give up lol. I was Googling about what an amicable number was, found this CodeProject link, explained it quite well... problem was, it had accompanying code and now I can't get it off my mind. Did some code and it uses a similar algorithm :/
Originally Posted by freedompeace
I give up lol. I was Googling about what an amicable number was, found this CodeProject link, explained it quite well... problem was, it had accompanying code and now I can't get it off my mind. Did some code and it uses a similar algorithm :/
The algorithm is pretty obvious anyway, I'm sure most people will devise something similar anyway :P
The two solutions I've seen so far (HD's and master131's) both use a nearly identical method.
@Freedom: You're better off bruteforcing, the algorithms I found on google(based on p q and r being primes etc) only generate a few of the pairs, so you won't have all of them.
@Freedom: You're better off bruteforcing, the algorithms I found on google(based on p q and r being primes etc) only generate a few of the pairs, so you won't have all of them.