A complete number is a 9-digit number that contains each of the digits 1 to 9 exactly once. The difference number of a number N is the number you get by taking the differences of consecutive digits in N and then stringing these digits together. For instance, the difference number of 25143 is equal to 3431. The complete number 124356879 has the additional property that its difference number, 12121212, consists of digits alternating between 1 and 2.
Determine all a with 3 ≤ a ≤ 9 for which there exists a complete number N with the additional property that the digits of its difference number alternate between 1 and a.
I got the following with an uninteresting brute force code. If you wish the "difference" numbers to instead alternate a,1,a,1,a,1,a,1, just read the numbers listed below backwards.
Solutions were found for only a= 2, 4, and 5.
lord@rabbit-3 12185 % c
1 2
124356879
124356897
986754213
986754231
1 4
126598437
126734895
984376215
984512673
1 5
549832761
561278349
Edited on December 9, 2020, 9:24 am