Solution of the Week #484 - Twin Numbers

Consider three types of digit:

A=odd = 1,3,5,7,9

B=even but not divisible by 4 = 2,6

C=divisible by 4 = 4,8

For the three digit number to be divisible by 4, it is sufficient that the number formed by the final two digits is divisible by 4. So if it ends on a C digit the middle digit has to be even (B or C), but if it ends on a B digit the middle digit must be odd (A).

So we must end with AB, BC or CC.

The possible arrangements with at least one odd digit are therefore:

AAB

BAB

CAB

ABC

ACC

A number of the form of ABC can be rearranged to one of the form CAB and vice versa. For each of the other cases, simply swap the position of the two digits of the same type to find the alternative number. For example 128 pairs with 812, 132 with 312, 216 with 612, and 748 pairs with 784.