Sunday, September 13, 2009

Project Euler Problem 7

Using Mathematica, this one was way too easy.


Problem 7
28 December 2001
By listing the first six prime numbers :
2, 3, 5, 7, 11, and 13, we can see that the 6^(th) prime is 13.
What is the 10001^(st) prime number?

In[1]:= Prime[6]

Out[1]= 13

In[2]:= Prime[10001]

Out[2]= 104743



I think the point of these earlier ones is that you need to be able to easily come up with building blocks for later problems. If that's the case, I won't feel robbed of having written an algorithm to do this.

No comments:

Post a Comment