The hypothesis of "six degrees of separation" says that any two people in the world can be coected through a chain of six friends or fewer. We will test this out with the prime numbers instead of people. Given two prime numbers with no more than 5 digits each, is it possible to coect them with a chain of prime numbers, each of which has no more than 5 digits, A chain of prime numbers for us is a sequence of prime numbers where each number only differs from the previous number in digits. For example: here are two chains of prime numbers. 55547-> 55147-> 53147-> 53117-> 53113-> 93113-> 93133->93139 8017->17->317->313->373->1373 This shows that the separation between 8017 to 1373 is no more than 5, and the separation between 55547 to 93139 is no more than 7 , and the separation between two prime numbers p and q is the shortest chain of prime numbers, each with five or fewer digits, that goes from p to q. The two chains above are actually the shortest possible for those numbers. Note that 17 is treated at 00017 and 8017 is treated as 08017 for the purposes of counting digits. Your team will write a program to determine the separation between arbitrary pairs of prime numbers. We are only conceed with the numbers that have 5 digits or fewer. You program will take two numbers as input and retu the separation between them. if there is no chain between the numbers ,your program will output "impossible". You can assume that the input numbers will always be prime. Here are some examples:
$ echo "55547 93139" | ./ref2.out separation : 7
$ echo "15017 14923" | ./ref2.out separation: 4
