# Sum of quadratic residues in $[1,p)$ [duplicate]

Show that if $p$ is a prime of the form $4k + 1$, the sum of quadratic residues ($\bmod p$) in the interval $[1, p)$ is $\frac{p (p - 1)}{4}$.

My attempt :

I could prove that the sum of the quadratic residues $\bmod p$ is $\frac{k ( 2k + 1 ) ( 4k + 1 )}{3} \bmod p$ (where $p = 4k + 1$). $p$ already divides this.

So, the sum of quadratic residues is a multiple of $p$.

What else can I try ?

-

## marked as duplicate by DonAntonio, William, LVK, J. M., Rudy the ReindeerOct 3 '12 at 8:35

Thanks for the edit ! I'll be more careful in future. – jatin Sep 4 '12 at 16:50
This is an exact duplicate. I guess I should do a thorough search before posting. Can a moderator please close this ? – jatin Sep 4 '12 at 17:11
Don't worry, @Jatin. Though a thorough search is always advisable, sometimes not even veterans can find stuff. – DonAntonio Sep 4 '12 at 17:25

From here, the number of quadratic residue of an odd prime is $\frac{p-1}{2}$.

Now, if $x$ is a quadratic residue of $mod\ p$ , so is $p-x$ as $-1$ is a quadratic residue of any prime $≡1\pmod 4$.

Using Legendre Symbol, $(\frac{-x}{p})=(\frac{-1}{p})(\frac{x}{p})=(-1)^{\frac{p-1}{2}}(\frac{x}{p})=(\frac{x}{p})$ if $p≡1\pmod 4$.

So, we can always find an integer $p-x<p$ for each and every quadratic residue of $x<p$, so that their sum is $p$.

And $x≢p-x$ if $p$ is odd.

Clearly, there are in-congruent $\frac{p-1}{4}$ pairs if $4\mid(p-1)$ each pair having sum$=p$.

-
This makes sense. Thanks ! – jatin Sep 4 '12 at 16:56
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://math.stackexchange.com/questions/191016/sum-of-quadratic-residues-in-1-p", "fetch_time": 1469655405000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2016-30/segments/1469257827079.61/warc/CC-MAIN-20160723071027-00040-ip-10-185-27-174.ec2.internal.warc.gz", "warc_record_offset": 155212394, "warc_record_length": 16342, "token_count": 537, "char_count": 1546, "score": 4.125, "int_score": 4, "crawl": "CC-MAIN-2016-30", "snapshot_type": "latest", "language": "en", "language_score": 0.7915604710578918, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00007-of-00064.parquet"}