Okay, I wasn't sure where to post this, because it involves number theory, but since I am asking a question about probabilities, and I think it is fairly simple (I am not a star in prob's), I guess it belongs here.

Say we have the progression :

$\displaystyle x_1 = a^2 \ mod \ n$

$\displaystyle x_{m + 1} = (x_m + a)^2 \ mod \ n$

With $\displaystyle n$ a composite number (for instance $\displaystyle 35 = 5 \times 7$), and a a positive integer in $\displaystyle \sqrt{n} \leq a < n.$

Question: what is the probability that a number $\displaystyle a$ picked at random in its interval generates a sequence in which $\displaystyle x_m$, with $\displaystyle m < \ln^2(n)$, shares a common factor with $\displaystyle n$ ? You may express your answer in terms of $\displaystyle a$, $\displaystyle n$, and $\displaystyle p_n$ (where $\displaystyle p_n$ is the n'th prime factor of $\displaystyle n$)

I am really stumped on this question, there is a lot of information and I don't know where to start. I think it might be useful to use the prime factors of $\displaystyle n$, but I just don't know where to start the answer .

Thanks a lot !