Probability that $x^2+y^2$ is divisible by $5$ and $7$ Two natural numbers $x$ and $y$ are chosen at random with a uniform distribution.Then the question is to find out the probability that $x^2+y^2$ is divisible by $5$ and $7$.
I understand that divisible by $5$ and $7$ is the same thing as divisible by $35$.But I am a bit confused on how to calculate probability on an infinite set.Any help shall be highly appreciated.Thanks.
 A: First thing to note: you can not just take a "random number with a uniform distribution". My intuition "why not". Imagine you selected a random number. How big would it be? No way it will be less than a million: million is too small compared to infinity. And whatever upper bound you imagine the randomly selected number must be bigger than that. So there is some problem with "uniformly distributed integers". It's just an intuition, but hope it helps.
To fix the text of your problem it's necessary to set up an upper bound for selected numbers. Something like "Two natural numbers x and y are chosen at random with a uniform distribution in a range (0, N). Find the probability that $x^2+y^2$ is divisible by 35 for large N".
Probability that $x≡n \mod 35$ is 1/35. Probability that remainders of $x$ and $y$ when divided by 35 are $n$ and $m$ is $1/35^2$.
I had to write a short program that calculates $(x^2 + y^2) \mod 35$ (which is equal to $(n^2+m^2)\mod 35$) for all 35^2 possible pairs of $(n, m)$. It turned out that there are exactly 5 pairs such that $(n^2 + m^2)$ is divided by 35. So, the answer is $5/35^2$.
Takahiro's approach must be smarter, but I am too slow to follow it :)
A: If $x$ and $y$ are uniformly distributed mod $35$ then both of them are independently uniformly distributed mod $5$ and mod $7$, by the Chinese remainder theorem.
The quadratic residues mod $5$ are $\>0$, $\>1$, $\>-1$, $-1$, $\>1$. The probability that two independently selected of these sum to $0$ mod $5$ is ${1\over5}\cdot{1\over5}+{4\over5}\cdot{2\over5}={9\over25}$.
The  quadratic residues mod $7$ are $\>0$, $\>1$, $-3$, $\>2$, $\>2$, $-3$, $\>1$. The probability that two independently selected of these sum to $0$ mod $7$ is ${1\over49}$.
It follows tht the probability in question is ${9\over 25\cdot 49}$.
A: $1^2≡1, 2^2≡4, 3^2≡2, 4^2≡2, 5^2≡4, 6^2≡1 \mod 7$.　
Then $x,y$ are multiple of $7$.     Since about one's place $1+7^2≡1+9,4^2+7^2≡6+9,  4^2+8^2≡6+4,1^2+8^2≡1+4≡0\pmod5$, these are multiple of 5. Therefore they are 9 patterns of $(0,0)(7,14)(7,21)(14,7)(14,28)(21,7)(21,28)(28,14)(28,21) \pmod{35}$$$\dfrac9{35^2}=0.735\%$$
