Saturday, January 22, 2011

Project Euler - Problem 3

Time for another one! I'm getting through these faster than I would've thought!

This one took me a bit more time simply because I made some stupid mistakes, mainly forgetting operation precedence and leaving out a set of brackets. I probably should start commenting my code and learn to use the debugging tools in Eclipse.

Problem 3
The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

Thursday, January 20, 2011

Project Euler - Problem 2

Work is over! Time for another puzzle!

Problem 2
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

Project Euler - Problem 1

So I discovered I still have Eclipse (the Java IDE) set up on my laptop. Lets see if I can knock the first problem off before work. That gives me... half an hour.

Problem 1
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.

THE BEGINNING

So this year I'm starting my first full year at Adelaide Uni doing a bachelors degree in Computer Science. I was at UniSA doing Software Engineering for a year back in 2009 but I was absolutely hating that and couldn't get myself motivated. Hopefully Adelaide will be better.

To try to keep myself interested I've decided to take on a number of side projects, one of which will be the mathematical programming challenges site, Project Euler. I'm going to aim to do one problem a week, each of which must be complete by 12:00AM on Mondays (although I'll probably speed through the first couple because I've done a few of them before). Each post here will include my source code and any working I used.

There's probably more I could say in this introductory post but I can't think of anything else now.
Good luck, me!