Prime combination lock
Today we will play with a multi-digits combination lock. Our aim will be to produce prime integers – and only prime integers. We start, let's say, with a lock whose 10 disks display zero (disk can only display the 10 digits – no letters or symbols). 0000000000 We always read an integer from left to right, without considering the leading zeros. This is how the prime number 30307 is displayed, for instance: 0000030307 Starting with ten zeros, we are forced to use the rightmost disk to produce our first prime (using another disk would display a composite number – ending in zero). Say we start with 2: 000000000 2 (Note that once we have displayed a prime number p , we cannot reproduce it again.) As we want to produce a distinct prime, we have no choice here: we must rotate the rightmost disk again and stop elsewhere. Say we display 7: 000000000 7 Our collection of primes is rich now in two elements: 2 and 7. To produce another element, we have the choice – for the first time. We ca...