Did you like how we did? Rate your experience!



46 votes

How do I find the greatest natural number, in which any two?

A2A: My first interpretation: There is no such greatest. E.g., 818181 is such a number and it can go on as long as you like. My second interpretation: Any 2-digit pair can occur only once in the entire sequence of the number. That is interesting. I think the answer is 725001649818. We are talking about finding a longest path in a directed graph for which we could label the vertices with 00, 01, 02, 04, 08, 09, 16, 18, 25, 32, 36, 49, 50, 64, 72, 81, 98 and for which there is an edge from a given vertex to another if and only if the last digit of the given vertexs label is the same as the first digit of the others. The fact that 3 and 7 have no predecessor, removes 32, 36, and 72 from consideration for anything but starting the sequence. The fact that there is only one successor for vertices with labels ending in 4, 6, 7, 8, or 9 forces 649818 when starting from 6. If we finished with 6 there and tried to continue, we would be looping back into the same sequence. 8 is bigger. We cannot continue from there without repeating 81. Preceding the 6, we cannot use 3 and continue. So we must use 1. Preceding 1, we cannot use 8, as that would repeat 81. We can use 0, which can be preceded by or 5. So use one more and then the 5. Preceding a 5 can only be a 2. If we preceded that with a 0, we would be forced to repeat the 50 since leading 0s dont increase the value. So we must precede it with a 3 or a 7, and we are done. If the rule is that each digit can only be used only once in the entire sequence, then wed have to trim the above answer down to 725016498. If the rule is that 00 cannot be used, then we need only trim it down to just 72501649818.