Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Serret's algorithm(1848) proved Fermat's theorem on sums of two squares as follows: $p\equiv1\pmod4, u^2+1=kp, 1\leqslant u<\frac{p}2$

$r_0=p, r_1=u$, then Euclidean Algorithm $$r_0=q_1r_1+r_2$$ $$r_1=q_2r_2+r_3$$ $$...$$ $$r_{k-2}=q_{k-1}r_{k-1}+r_k,$$ where $ r_{k-1}>\sqrt{p}>r_k$. then determine $t_k$ such that $r_k\equiv ut_k\pmod p$ with $1\leqslant |t_k|<\sqrt{p}$ ?
we get that $r_k^2+t_k^2=p$

How to prove $ 1\leqslant |t_{k}|<\sqrt{p}$? thanks!

share|cite|improve this question
See this page for a hint: – Yuval Filmus Aug 18 '12 at 12:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.