|
|
|
|
|
by amyres
500 days ago
|
|
Since we're over-engineering here, one more optimization is to skip all potential GCDs that are divisible by 2 or 5. Suppose the GCD was divisible by 2, then all rows would be even. Since the last digit of an even integer is in {0,2,4,6,8} and we need 9 unique numbers in the final column, we know that 4 or 5 of the row numbers must be odd. So the GCD can't be even. Similarly, the GCD can't be divisible by 5. If it were, all rows numbers would need a 0 or 5 in the final digit. |
|