A new type of prime numbers are the focus of Problem 37 of Project Euler. This time the type of prime numbers is truncatable primes. I have never heard of this type of primes before, but the problem description gives a good explanation.Find the sum of the only eleven primes that are both truncatable from left to right and right to left.So we know that we are supposed to find 11 of these. I will present you with two similar approaches. The first one is pure brute force where we search through all primes until we hit the ones with the right property. In the other solution we will only generate numbers which are left truncatable and then check if the are right truncatable. However, both solutions are missing one important thing I think. They are missing a clear upper bound. I haven't been able to establish one through any means, so if you can share some insight to that I would be very happy to hear from you.

Continue reading...This site uses cookies.

Saturday, April 23, 2011

17 Comments