Associate
We should all chip in £2 or something to get the prize up
Any extra prizes for smallest source file/least amount of code?
And I take it we're free to use any libs available in the JDK?
Eurgh, trying to do stage 1, but I've got no idea why it says it's wrong .
Have stages 2, 3 and 4 working properly, they're just apparently getting the wrong number because of stage 1 .
I've just edited the first post - I made a small mistake with stage 1 sorry
Basically two values of n under 1.5 million produce the longest chain length. Go with the smaller of the two.
Edit again - Got all done apart from stage 5 and stage 9, need to find out how to do prime number calcs now .
My Python proof-of-concept for the whole job takes 72 seconds on a 6 core 4ghz box, needs some serious optimization re-factoring especially as people have mentioned it should take significantly less time.
Nine is interesting
2010-12-05 23:34:48.165 OcUK Xmas Programming Challenge[4587:a0f] start
2010-12-05 23:45:04.088 OcUK Xmas Programming Challenge[4587:a0f] complete
Ten minutes on a single thread (MBP, 2.4GHz C2D with 4GB 800MHz DDR2).. so just coding it up to split between the number of cores..
My coding skills are not great but just finished stage one. Took me way longer because of a stupid mistake.
Very fun challenge mind you had to put the thinking cap on big time.
I was using the etherstones method as it's meant to be faster.. :/
I was using the etherstones method as it's meant to be faster.. :/
All done now .
Works out at 303 Lines of code with blank lines and quite a few comments, gonna work on making it better tomorrow i think, getting late now.
Takes approximatly 3 seconds to run, timed by checking windows clock, pressing enter on command line then checking clock before it's finished (anyone know how i can see how long it takes to run properly? ).
I'll e-mail it to you once i've finished making it neater/more efficient etc .
I've only quickly read the OP - but you generate primes upto 1.5 million in 3 secs? You using a SuperDome?