The prime factorisation of binomial coefficients
This problem is very simple. It is actually almost doing the same thing as problem 429 does. I checked my old code. It takes more than 3 seconds to get the answer since I did not manage those factors very well. I revised the code a little bit. Now it only takes less than 0.5 second.
Sunday, June 30, 2013
Saturday, June 29, 2013
project euler problem 226
A Scoop of Blancmange
This problem is not very difficult. The most critical part is to find the intersection point between the curve and the circle. It looks like extremely difficult. But we just need an approximate answer. The rest part is just a numerical integral.
This problem is not very difficult. The most critical part is to find the intersection point between the curve and the circle. It looks like extremely difficult. But we just need an approximate answer. The rest part is just a numerical integral.
project euler problem 228
Minkowski Sums
This problem is simple once the property of Minkowski Sums is known. I learned it from Wikipedia. The problem is easy to solve. I guess this problem is created in honor of Hermann Minkowski since he was born in 1864 and passed away in January 12, 1909. Notice the problem is published in January 16, 2009.
This problem is simple once the property of Minkowski Sums is known. I learned it from Wikipedia. The problem is easy to solve. I guess this problem is created in honor of Hermann Minkowski since he was born in 1864 and passed away in January 12, 1909. Notice the problem is published in January 16, 2009.
Tuesday, June 25, 2013
project euler problem 429
Sum of squares of unitary divisors
Easiest problem in 2013. I take a look at the problem and find out it is extremely easy. No wonder 470+ people have already solved it. I wrote the code in 15 minutes and it is solved! I should admit that I used a few of my functions wrote for other problems. Without those functions, I will need a little bit more time.
Try it, it is easy. Everyone feels happy to solve this problem!
Easiest problem in 2013. I take a look at the problem and find out it is extremely easy. No wonder 470+ people have already solved it. I wrote the code in 15 minutes and it is solved! I should admit that I used a few of my functions wrote for other problems. Without those functions, I will need a little bit more time.
Try it, it is easy. Everyone feels happy to solve this problem!
project euler problem 354
Distances in a bee's honeycomb
This problem is relatively easy for people who have solved 300+ problems, although only 230 people solved it. But one needs to find the "magic formula" for this problem. It is not that hard to find the formula. Figuring out those examples are close. It takes 13 seconds for my code to get the answer.
This problem is relatively easy for people who have solved 300+ problems, although only 230 people solved it. But one needs to find the "magic formula" for this problem. It is not that hard to find the formula. Figuring out those examples are close. It takes 13 seconds for my code to get the answer.
Saturday, June 22, 2013
project euler problem 229
Four Representations using Squares
This problem is very difficult if one can fully understand the math behind the problem and solve it in a mathematical way. But If we do not mind to solve it in an easier way, it is kind of straight forward and the code is easy to write. We have used this method to find primes, factors of numbers, etc....
I tried to reduce the memory usage and break the whole range into a lot of small segments. The memory usage is reduced and the problem is solved in much less time! I used 11.8 seconds to get the answer.
Although I still need to understand more about the math behind the problem, I still learned some math about Jacobi symbol! The property of Jacobi symbol is really amazing!
This problem is very difficult if one can fully understand the math behind the problem and solve it in a mathematical way. But If we do not mind to solve it in an easier way, it is kind of straight forward and the code is easy to write. We have used this method to find primes, factors of numbers, etc....
I tried to reduce the memory usage and break the whole range into a lot of small segments. The memory usage is reduced and the problem is solved in much less time! I used 11.8 seconds to get the answer.
Although I still need to understand more about the math behind the problem, I still learned some math about Jacobi symbol! The property of Jacobi symbol is really amazing!
Thursday, June 20, 2013
project euler problem 230
Fibonacci Words
This problem is quite simple. It is straight forward to solve although the problem looks like formidable.
This problem is quite simple. It is straight forward to solve although the problem looks like formidable.
Subscribe to:
Posts (Atom)