Over the past couple of years I keep on coming back to Project Euler, it’s nice when you just want a quick challenge, or to try your maths skills. It’s highlighted how rusty some of my concepts were, and I’ve learnt a whole load of new ones along the way. I really like the way that the example problem given is quite quick to determine using brute force, but the desired answer always needs a more considered approach.
I’ve just completed problem 26, to determine value of d (1/d) where d < 1,000 and resulted in the largest recurring cycle of the decimal fraction. My first (working) solution completed the task in 2.8 seconds, well within the proposed ideal time frame. What's really helpful is then reading through the forum of previous solutions you can pick up some ideas that start to bring the entire process down to under a second!
You can see my progress in the graphic on the right hand side, or can check my progress on the project euler site.
I’m trying to start up on project Euler again, one thing I do like is that it highlights how poor some of my maths knowledge actually is. Neither school or college covered many of these algorithms; which is a bit of a surprise given that I did a four-year mechanical apprenticeship with applied mathematics…..still never too late to learn So I (re)started on problem 24 which read: A permutation is an ordered arrangement of objects. . . .
The challenge set by problem 18 was By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. A 15-row triangle was then supplied for which the program must determine the corresponding maximum value taking a similar path . . .