Skip to main content

Posts

Showing posts with the label problem37

Problem 37 Project Euler Solution with python

Truncatable primes The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3. Find the sum of the only eleven primes that are both truncatable from left to right and right to left. NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes. I would like to call this problem an extension for Problem 35 for which we have already written a solution. You can see the solution from here: Problem 35 Project Euler Solution with python Now with this problem, it just took me a few minutes to write the code.But the real problem before I started writing the code was the upper bound. I have searched on internet for finding the upper bound, but couldn't get any, so I have assumed the upper bound to be 1 million. I don't have any reason for that. It's just an assumption by me. O...