Jump to content

Truncatable primes: Difference between revisions

Number base is 10
m (added 'a')
(Number base is 10)
Line 2:
A truncatable prime is a prime number that when you successively remove digits from one end of the prime, you are left with a new prime number; for example, the number 997 is called a ''left-truncatable prime'' as the numbers 997, 97, and 7 are all prime. The number 7393 is a ''right-truncatable prime'' as the numbers 7393, 739, 73, and 7 formed by removing digits from its right are also prime. No zeroes are allowed in truncatable primes.
 
The task is to find the largest left-truncatable and right-truncatable primes less than one million (base 10 is implied).
 
C.f: [[Sieve of Eratosthenes]]; [http://mathworld.wolfram.com/TruncatablePrime.html Truncatable Prime] from Mathworld.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.