I donβt know the worst case scenario, but using the fact that M <2 64, I can link it higher with 292 iterations and lower by 53 (except for the restriction that the N / M ratio is approximately fixed).
Let p 1 , ..., p k be primes greater than or equal to 5 by which M is divisible. Let N 'β₯ N be the smallest integer such that N' = 1 mod 6 or N '= 5 mod 6. For each i = 1, ..., k, the prime p i divides the maximum maximum (49 / p i ) integers N ', N' + 6, N '+ 12, ..., N' + 288. The upper bound on Ξ£ i = 1, ..., k ceil (49 / p i ) is Ξ£ i = 3 , ..., 16 ceil (49 / q i ) = 48, where q are primes starting from q 1 = 2. (This follows from the fact that Ξ i = 3, ..., 17 β₯ 2 64 means that M is the product of no more than 14 different primes other than 2 and 3.) We conclude that at least one of the integers mentioned is mutually prime with M.
For a lower bound, let M = 614889782588491410 (the product of the first fifteen prime numbers) and let N = 1. After 1, the first integer, relatively prime with the first fifteen prime, is the sixteenth prime 53.
I expect both borders to be improved without much effort, although this is not clear to me. For the upper bound, handle separately the case when 2 and 3 are both divisors of M, since then M can be a product of at most 13 other prime numbers. For the lower bound, one could find a good M by running the Eratosthenes sieve to calculate for a whole series of integers of primes dividing these integers. Then expand the window over the entire range; if the product of individual strokes in the window is too large, advance the end of the back of the window; otherwise, advance the front end.
source share