Suppose we have a function $f(n) = 1$ when $n \equiv x mod M$ and $0$ otherwise, but I don't know $M$.
Also suppose I know $f = 0$ for a subset of $q$ natural numbers.
How I can delimit $M$? That is, $M > m1$.
There are exist a known algorithm fo such a problem?
Any clue to investigate further is welcome.
Edit: $x$ is fixed and unknown.
Edit2: One trivial algorithm is just test all possible values of M from 2 to $q$. I look for a more optimal algorithm because $M$ and $q$ can be big ($10^5$).
Suppose, $f=0$ for $k$ consecutive natural numbers. Then, we can conclude $M>k$ because of $M$ consecutive integers , there must be one congruent to $x$ modulo $M$