1

Let us say we have the sets of quadratic residues $X = \lbrace x^2 \pmod{p}\rbrace$ and $Y = \lbrace y^2 \pmod{q}\rbrace$.

Is there a way to construct the set of quadratic residues $Z_{\beta} = \lbrace x : x \equiv z^2 \pmod{pq} \land x < \beta \rbrace$ without having to go through $X \times Y$ and applying the Chinese Remainder Theorem $|X \times Y|$ times?

vvg
  • 3,526
  • 2
    Other than squaring all the numbers from $1$ to $pq$ (or even $pq/2$) and throwing out the multiples of $p$ or $q$? – Greg Martin Oct 01 '22 at 21:04

1 Answers1

1

You can compute the two specific numbers $e, d \bmod pq$ with the property that

$$e \equiv 1 \bmod p, e \equiv 0 \bmod q$$ $$d \equiv 0 \bmod p, d \equiv 1 \bmod q.$$

Then to find a number congruent to $x \bmod p, y \bmod q$ you just compute $ex + dy \bmod pq$.

Qiaochu Yuan
  • 468,795
  • @user33096: it's not exactly a contest. It stands for American Mathematical Monthly, they publish problems and then solicit solutions which they then also publish: https://www.mat.uniroma2.it/~tauraso/AMM/amm.html – Qiaochu Yuan Oct 02 '22 at 02:19
  • thanks. Could you explain why a question I posted that came from the AMM was downvoted? Is it possible people just downvoted for no good reason? Like most of my hard questions, when I wrote it, I really didn't know how to make any significant progress on it. I think it should be totally fine if that question receives an answer and I think that question is a useful one to learn from. For reference, here is the question. – user33096 Oct 02 '22 at 17:53