deepblue's blog

Problem #5 and my huge blunder

I started working on problem 5 and it took about 20 minutes. I was quite happy with my solution, but as soon as I read the first reply in the solution thread I immediately realized what a big dumbass I am. This is what happens when you don't see what the problem is really asking and you don't put a lot of thought into it. My solution is definitely the opposite of elegant and is not worthy of posting.

 

Problem #5

 

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

Project Euler Problem #3

I finally found the answer to problem 3. It certainly isn't an efficient solution being that it's a brute force technique. In fact there are only 4 prime factors to the very large number in the problem. It isn't that they are hard to find, it's checking every number that makes it take so long. The funnest thing about solving these problems is seeing other peoples solutions in the thread - some, if not most, are infinitely better than mine!

 

Problem #3

 

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

What is the largest prime factor of the number 600851475143 ?

 

Project Euler Problems #1 and #2

I've been mighty bored this summer since I decided to take it off from school and drop my summer class (BIG MISTAKE), so I decided to delve into the Project Euler problems (http://projecteuler.net/). I only finished #1 and #2 so far and am working on #3. I work full-time so I still don't have much time to dedicate to it. I don't think this will get read much, but there is maybe someone on here who can potentially benefit from reading these solutions.

 

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.

 

Syndicate content