CodePudding user response:
The practice of the fixed mind you shouldSet a x, x %==1, 2 x % 3==0,... , does not meet the x++
Then optimize slightly, since be in multiples of nine, x++ can become x +=9, initial value assignment of 9, x x % 9, x % 3 don't need to judge, the remaining in the same way
Then optimization, since both in multiples of nine and seven multiples, LCM is 63, ditto optimization
So simple way is the case
CodePudding user response:
N=1 * 3 * 7 * 9=in multiples of 189 or 189;189=2 * 94 + 1;
189=4 * 47 + 1;
38-189=5 * 1;
189=6 * 31 + 3
189=8 * 24-3? Or 189=8 * 23 + 5?