I have a number that I like. It is 6 digits long and consist of the digits 1, 2, 3, 4, 5, and 6.
The reason why I like the number is because the sum of any 2 adjacent numbers is a prime number, and the sum of the first and last number is also a prime number!
If the 1st digit of the number is 1, what is the 4th digit of the number?
For example, 123456 is not the number, as the sum of 4 and 5 is 9, which is not prime.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We may find pairs of { 1 , 2 , 3 , 4 , 5 , 6 } such that their sum is a prime number.
( 1 , 2 ) , ( 1 , 4 ) , ( 1 , 6 ) , ( 2 , 3 ) , ( 2 , 5 ) , ( 3 , 4 ) , ( 5 , 6 )
Order does not matter. Then make a graphs with 6 nodes, named by the numbers { 1 , 2 , 3 , 4 , 5 , 6 } . there would be an edge between two nodes iff their corresponding numbers make a pair that exist in the set above. Making a desired number is equivalent to making a Hamiltonian cycle on the graph. Since the first digit (from the left) is 1 , we should start from node 1 and return to node 1 . node 1 has three neighbours. If we go to node 2 , in the first step, then we are gonna have to take one of the two cycles of length 4 to return to 1 . But, a Hamiltonian cycle is of length 6 . If we go to either 4 or 6 from 1 , then we can successfully complete a Hamiltonian loop and in both cases, the fourth digit is 2 .