Project Euler

Project Euler — problem 4

May 29, 2012 | Tony

It’s midnight already. I’m going to bed after I type this. Now the fourth Euler problem: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99. Find … Continue reading → [Read more...]

Project Euler — problem 3

May 27, 2012 | Tony

The third problem: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? My solvement is straightforward: firstly to identify all the prime numbers between 2 and sqrt(n); secondly … Continue reading → [Read more...]

Project Euler — problem 2

May 21, 2012 | Tony

Almost my time for bed. Just write a quick solution on the second problem of Project Euler. Here it is. Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, … Continue reading → [Read more...]

R solvements to Project Euler — problem 1

May 15, 2012 | Tony

Things have been going wild since I opened this blog. Tasks were piled up while I was tight on time. At present, I’m facing a major challenge in my life. However, I decide to spare some time for self-improvements. R … Continue reading → [Read more...]

Project Euler: problem 6

September 27, 2011 | MK

The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2 = 552 = 3025Hence the difference between the sum of the squares o...
[Read more...]

Project Euler: problem 3

September 21, 2011 | MK

The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?This one was quite easy, and much easier in R as it turns out.The GNU Multi-Precision Library (GMP) is available as a package in R. So the only ...
[Read more...]

Project Euler: problem 2

September 16, 2011 | MK

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 exc...
[Read more...]

Project Euler: problem 1

September 15, 2011 | MK

To be fairly honest (assuming there are degrees of honesty), I do know a little about math and programming but I don't know much math or any programming. I've loved math for a long time, but started to learn and understand fairly recently. So during th...
[Read more...]

[Project Euler] – Problem 57

May 19, 2011 | R on Guangchuang Yu

It is possible to show that the square root of two can be expressed as an infinite continued fraction. √ 2 = 1 + 1/(2 + 1/(2 + 1/(2 + … ))) = 1.414213… By expanding this for the first four iterations, we get: Read More: 547 Words Totally [Read more...]

Project Euler — Problem 187

December 23, 2010 | R on Guangchuang Yu

http://projecteuler.net/index.php?section=problems&id=187 A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3. There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26. Read More: 671 Words Totally [Read more...]
1 2

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)