3 ms·
> you can stop as soon as the lcm's of your subsets exceed N Actually if N < 2 * lcm, because you can't use the fact that the distribution of multiples is the
by chupasaurus 7y ago
> you can stop as soon as the lcm's of your subsets exceed N
Actually if N < 2 * lcm, because you can't use the fact that the distribution of multiples is the same on (1, lcm) and (k * lcm+1, lcm(k+1)) while you still have to count on (N - N mod lcm + 1, N).