How to prove that the number of solutions of $ x^2 equiv a pmod{p}$ is 0 or 2?












1












$begingroup$


I want to prove that the equation $ x^2 equiv a pmod{p}$ either doesn't have or has 2 solutions.



(p is odd prime , a is integer , a $ne pk$ )










share|cite|improve this question











$endgroup$

















    1












    $begingroup$


    I want to prove that the equation $ x^2 equiv a pmod{p}$ either doesn't have or has 2 solutions.



    (p is odd prime , a is integer , a $ne pk$ )










    share|cite|improve this question











    $endgroup$















      1












      1








      1


      1



      $begingroup$


      I want to prove that the equation $ x^2 equiv a pmod{p}$ either doesn't have or has 2 solutions.



      (p is odd prime , a is integer , a $ne pk$ )










      share|cite|improve this question











      $endgroup$




      I want to prove that the equation $ x^2 equiv a pmod{p}$ either doesn't have or has 2 solutions.



      (p is odd prime , a is integer , a $ne pk$ )







      number-theory elementary-number-theory modular-arithmetic






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 7 '12 at 17:20









      P..

      13.4k22348




      13.4k22348










      asked Dec 7 '12 at 17:03









      WorldWorld

      1831211




      1831211






















          5 Answers
          5






          active

          oldest

          votes


















          0












          $begingroup$

          If $y$ is a solution of $x^2equiv apmod pimplies y^2equiv apmod pimplies (-y)^2equiv apmod pimplies -y$ is also a solution.



          Let $z$ be another solution, so $z^2equiv apmod pequiv y^2pmod p$



          $implies pmid (z+y)(z-y)implies zequiv pm ypmod p$



          So if there is a solution, there will be exactly one more.



          For the existence of solution for $pge 3$, we can try in the following way:



          if $g$ is a primitive root of $p,$ taking discrete logarithm with respect to $g$ on $x^2equiv apmod p$ we get,



          $2 ind_gxequiv ind_gapmod{p-1}$ as $phi(p)=p-1$



          As $p-1$ is even and $ind_gx$ must be some integer $in[0,p-1],$



          $ind_gxequiv frac{ind_ga}2pmod{frac{p-1}2}implies ind_ga$ must be even to admit any solution.



          For example, if $aequiv-1pmod p, ind_ga=frac{p-1}2 implies 4mid (p-1)$






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            can you show me how to i prove that $x^2 equiv a$ hasn't solution?
            $endgroup$
            – World
            Dec 7 '12 at 17:45












          • $begingroup$
            @World, please find the edited answer.
            $endgroup$
            – lab bhattacharjee
            Dec 7 '12 at 18:01










          • $begingroup$
            when we haven't solution? I don't understand.
            $endgroup$
            – World
            Dec 7 '12 at 18:18










          • $begingroup$
            @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
            $endgroup$
            – lab bhattacharjee
            Dec 7 '12 at 18:22



















          1












          $begingroup$

          Suppose that $a$ is not divisible by the odd prime $p$. We show that if the congruence $x^2equiv a$ has a solution, then it has exactly two. As shown by DonAntonio and Pambos, if there is a solution then there are at least two.



          We show that there are no more than two. Suppose that $r^2equiv apmod{p}$. Then if $x^2equiv apmod{p}$, we have $x^2equiv r^2pmod{p}$.



          It follows that $p$ divides $x^2-r^2$, that is, $p$ divides $(x-r)(x+r)$. But since $p$ is prime, it follows that $p$ divides $x-r$ or $p$ divides $x+r$. That says that $xequiv rpmod{p}$ or $xequiv -rpmod{p}$.






          share|cite|improve this answer











          $endgroup$





















            1












            $begingroup$


            1. If there is solution, then there is a second (different).
              Observe that $$(p-x)^2 = x^2 - 2px + p^2,$$ so $$(p-x)^2 = x^2 pmod p.$$
              Now assume that $x = p-x$, then $p = 2x$ and $p$ would be even (contradiction), so $x neq p-x$.


            2. There are at most two different solutions modulo $p$.
              Let $x^2 = a pmod p$ and $y^2 = a pmod p$ then
              $$x^2 - y^2 = 0 pmod p,$$
              $$(x+y)(x-y) = 0 pmod p,$$
              that is $y = x pmod p$ or $y = -x pmod p$.


            3. This means that there may be more solutions like $x+p, x+2p, ldots$, but at most two modulo $p$.



            Cheers!






            share|cite|improve this answer











            $endgroup$













            • $begingroup$
              Thanks. what is mean $p-x ne x$ .can you explain more about this.
              $endgroup$
              – World
              Dec 7 '12 at 17:51










            • $begingroup$
              We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
              $endgroup$
              – dtldarek
              Dec 7 '12 at 18:22



















            0












            $begingroup$

            When you are working mod $p$, you are actually working in the field $mathbb{Z}/pmathbb{Z} = mathbb{F}_p$. So, your statement translates to whether a polynomial of degree $2$ has roots in $mathbb{F}_p$ (which is not guaranteed because $mathbb{F}_p$ is not algebraically closed), and if it does have a root, how many roots can it have in total (namely $2$, because any quadratic polynomial has at most $2$ roots in any field, and if one root of a quadratic polynomial is in the field, the other root must also be in the field).






            share|cite|improve this answer









            $endgroup$





















              0












              $begingroup$

              $$x^2=apmod pLongleftrightarrow (-x)^2=apmod p$$



              and since $,p,$ is an odd prime, $,xneq -x,$ whenever $,xneq 0,$






              share|cite|improve this answer











              $endgroup$













                Your Answer





                StackExchange.ifUsing("editor", function () {
                return StackExchange.using("mathjaxEditing", function () {
                StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
                StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
                });
                });
                }, "mathjax-editing");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "69"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                noCode: true, onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f253168%2fhow-to-prove-that-the-number-of-solutions-of-x2-equiv-a-pmodp-is-0-or-2%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                0












                $begingroup$

                If $y$ is a solution of $x^2equiv apmod pimplies y^2equiv apmod pimplies (-y)^2equiv apmod pimplies -y$ is also a solution.



                Let $z$ be another solution, so $z^2equiv apmod pequiv y^2pmod p$



                $implies pmid (z+y)(z-y)implies zequiv pm ypmod p$



                So if there is a solution, there will be exactly one more.



                For the existence of solution for $pge 3$, we can try in the following way:



                if $g$ is a primitive root of $p,$ taking discrete logarithm with respect to $g$ on $x^2equiv apmod p$ we get,



                $2 ind_gxequiv ind_gapmod{p-1}$ as $phi(p)=p-1$



                As $p-1$ is even and $ind_gx$ must be some integer $in[0,p-1],$



                $ind_gxequiv frac{ind_ga}2pmod{frac{p-1}2}implies ind_ga$ must be even to admit any solution.



                For example, if $aequiv-1pmod p, ind_ga=frac{p-1}2 implies 4mid (p-1)$






                share|cite|improve this answer











                $endgroup$













                • $begingroup$
                  can you show me how to i prove that $x^2 equiv a$ hasn't solution?
                  $endgroup$
                  – World
                  Dec 7 '12 at 17:45












                • $begingroup$
                  @World, please find the edited answer.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:01










                • $begingroup$
                  when we haven't solution? I don't understand.
                  $endgroup$
                  – World
                  Dec 7 '12 at 18:18










                • $begingroup$
                  @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:22
















                0












                $begingroup$

                If $y$ is a solution of $x^2equiv apmod pimplies y^2equiv apmod pimplies (-y)^2equiv apmod pimplies -y$ is also a solution.



                Let $z$ be another solution, so $z^2equiv apmod pequiv y^2pmod p$



                $implies pmid (z+y)(z-y)implies zequiv pm ypmod p$



                So if there is a solution, there will be exactly one more.



                For the existence of solution for $pge 3$, we can try in the following way:



                if $g$ is a primitive root of $p,$ taking discrete logarithm with respect to $g$ on $x^2equiv apmod p$ we get,



                $2 ind_gxequiv ind_gapmod{p-1}$ as $phi(p)=p-1$



                As $p-1$ is even and $ind_gx$ must be some integer $in[0,p-1],$



                $ind_gxequiv frac{ind_ga}2pmod{frac{p-1}2}implies ind_ga$ must be even to admit any solution.



                For example, if $aequiv-1pmod p, ind_ga=frac{p-1}2 implies 4mid (p-1)$






                share|cite|improve this answer











                $endgroup$













                • $begingroup$
                  can you show me how to i prove that $x^2 equiv a$ hasn't solution?
                  $endgroup$
                  – World
                  Dec 7 '12 at 17:45












                • $begingroup$
                  @World, please find the edited answer.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:01










                • $begingroup$
                  when we haven't solution? I don't understand.
                  $endgroup$
                  – World
                  Dec 7 '12 at 18:18










                • $begingroup$
                  @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:22














                0












                0








                0





                $begingroup$

                If $y$ is a solution of $x^2equiv apmod pimplies y^2equiv apmod pimplies (-y)^2equiv apmod pimplies -y$ is also a solution.



                Let $z$ be another solution, so $z^2equiv apmod pequiv y^2pmod p$



                $implies pmid (z+y)(z-y)implies zequiv pm ypmod p$



                So if there is a solution, there will be exactly one more.



                For the existence of solution for $pge 3$, we can try in the following way:



                if $g$ is a primitive root of $p,$ taking discrete logarithm with respect to $g$ on $x^2equiv apmod p$ we get,



                $2 ind_gxequiv ind_gapmod{p-1}$ as $phi(p)=p-1$



                As $p-1$ is even and $ind_gx$ must be some integer $in[0,p-1],$



                $ind_gxequiv frac{ind_ga}2pmod{frac{p-1}2}implies ind_ga$ must be even to admit any solution.



                For example, if $aequiv-1pmod p, ind_ga=frac{p-1}2 implies 4mid (p-1)$






                share|cite|improve this answer











                $endgroup$



                If $y$ is a solution of $x^2equiv apmod pimplies y^2equiv apmod pimplies (-y)^2equiv apmod pimplies -y$ is also a solution.



                Let $z$ be another solution, so $z^2equiv apmod pequiv y^2pmod p$



                $implies pmid (z+y)(z-y)implies zequiv pm ypmod p$



                So if there is a solution, there will be exactly one more.



                For the existence of solution for $pge 3$, we can try in the following way:



                if $g$ is a primitive root of $p,$ taking discrete logarithm with respect to $g$ on $x^2equiv apmod p$ we get,



                $2 ind_gxequiv ind_gapmod{p-1}$ as $phi(p)=p-1$



                As $p-1$ is even and $ind_gx$ must be some integer $in[0,p-1],$



                $ind_gxequiv frac{ind_ga}2pmod{frac{p-1}2}implies ind_ga$ must be even to admit any solution.



                For example, if $aequiv-1pmod p, ind_ga=frac{p-1}2 implies 4mid (p-1)$







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited Dec 13 '12 at 15:24

























                answered Dec 7 '12 at 17:22









                lab bhattacharjeelab bhattacharjee

                224k15156274




                224k15156274












                • $begingroup$
                  can you show me how to i prove that $x^2 equiv a$ hasn't solution?
                  $endgroup$
                  – World
                  Dec 7 '12 at 17:45












                • $begingroup$
                  @World, please find the edited answer.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:01










                • $begingroup$
                  when we haven't solution? I don't understand.
                  $endgroup$
                  – World
                  Dec 7 '12 at 18:18










                • $begingroup$
                  @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:22


















                • $begingroup$
                  can you show me how to i prove that $x^2 equiv a$ hasn't solution?
                  $endgroup$
                  – World
                  Dec 7 '12 at 17:45












                • $begingroup$
                  @World, please find the edited answer.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:01










                • $begingroup$
                  when we haven't solution? I don't understand.
                  $endgroup$
                  – World
                  Dec 7 '12 at 18:18










                • $begingroup$
                  @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
                  $endgroup$
                  – lab bhattacharjee
                  Dec 7 '12 at 18:22
















                $begingroup$
                can you show me how to i prove that $x^2 equiv a$ hasn't solution?
                $endgroup$
                – World
                Dec 7 '12 at 17:45






                $begingroup$
                can you show me how to i prove that $x^2 equiv a$ hasn't solution?
                $endgroup$
                – World
                Dec 7 '12 at 17:45














                $begingroup$
                @World, please find the edited answer.
                $endgroup$
                – lab bhattacharjee
                Dec 7 '12 at 18:01




                $begingroup$
                @World, please find the edited answer.
                $endgroup$
                – lab bhattacharjee
                Dec 7 '12 at 18:01












                $begingroup$
                when we haven't solution? I don't understand.
                $endgroup$
                – World
                Dec 7 '12 at 18:18




                $begingroup$
                when we haven't solution? I don't understand.
                $endgroup$
                – World
                Dec 7 '12 at 18:18












                $begingroup$
                @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
                $endgroup$
                – lab bhattacharjee
                Dec 7 '12 at 18:22




                $begingroup$
                @World, we need to identify a primitive root$g$ of $p$, the previous always exists for a prime, then find the index of $a$ with respect to $gpmod p,$ which must be even to admit any solution.
                $endgroup$
                – lab bhattacharjee
                Dec 7 '12 at 18:22











                1












                $begingroup$

                Suppose that $a$ is not divisible by the odd prime $p$. We show that if the congruence $x^2equiv a$ has a solution, then it has exactly two. As shown by DonAntonio and Pambos, if there is a solution then there are at least two.



                We show that there are no more than two. Suppose that $r^2equiv apmod{p}$. Then if $x^2equiv apmod{p}$, we have $x^2equiv r^2pmod{p}$.



                It follows that $p$ divides $x^2-r^2$, that is, $p$ divides $(x-r)(x+r)$. But since $p$ is prime, it follows that $p$ divides $x-r$ or $p$ divides $x+r$. That says that $xequiv rpmod{p}$ or $xequiv -rpmod{p}$.






                share|cite|improve this answer











                $endgroup$


















                  1












                  $begingroup$

                  Suppose that $a$ is not divisible by the odd prime $p$. We show that if the congruence $x^2equiv a$ has a solution, then it has exactly two. As shown by DonAntonio and Pambos, if there is a solution then there are at least two.



                  We show that there are no more than two. Suppose that $r^2equiv apmod{p}$. Then if $x^2equiv apmod{p}$, we have $x^2equiv r^2pmod{p}$.



                  It follows that $p$ divides $x^2-r^2$, that is, $p$ divides $(x-r)(x+r)$. But since $p$ is prime, it follows that $p$ divides $x-r$ or $p$ divides $x+r$. That says that $xequiv rpmod{p}$ or $xequiv -rpmod{p}$.






                  share|cite|improve this answer











                  $endgroup$
















                    1












                    1








                    1





                    $begingroup$

                    Suppose that $a$ is not divisible by the odd prime $p$. We show that if the congruence $x^2equiv a$ has a solution, then it has exactly two. As shown by DonAntonio and Pambos, if there is a solution then there are at least two.



                    We show that there are no more than two. Suppose that $r^2equiv apmod{p}$. Then if $x^2equiv apmod{p}$, we have $x^2equiv r^2pmod{p}$.



                    It follows that $p$ divides $x^2-r^2$, that is, $p$ divides $(x-r)(x+r)$. But since $p$ is prime, it follows that $p$ divides $x-r$ or $p$ divides $x+r$. That says that $xequiv rpmod{p}$ or $xequiv -rpmod{p}$.






                    share|cite|improve this answer











                    $endgroup$



                    Suppose that $a$ is not divisible by the odd prime $p$. We show that if the congruence $x^2equiv a$ has a solution, then it has exactly two. As shown by DonAntonio and Pambos, if there is a solution then there are at least two.



                    We show that there are no more than two. Suppose that $r^2equiv apmod{p}$. Then if $x^2equiv apmod{p}$, we have $x^2equiv r^2pmod{p}$.



                    It follows that $p$ divides $x^2-r^2$, that is, $p$ divides $(x-r)(x+r)$. But since $p$ is prime, it follows that $p$ divides $x-r$ or $p$ divides $x+r$. That says that $xequiv rpmod{p}$ or $xequiv -rpmod{p}$.







                    share|cite|improve this answer














                    share|cite|improve this answer



                    share|cite|improve this answer








                    edited Dec 7 '12 at 17:34

























                    answered Dec 7 '12 at 17:25









                    André NicolasAndré Nicolas

                    452k36422807




                    452k36422807























                        1












                        $begingroup$


                        1. If there is solution, then there is a second (different).
                          Observe that $$(p-x)^2 = x^2 - 2px + p^2,$$ so $$(p-x)^2 = x^2 pmod p.$$
                          Now assume that $x = p-x$, then $p = 2x$ and $p$ would be even (contradiction), so $x neq p-x$.


                        2. There are at most two different solutions modulo $p$.
                          Let $x^2 = a pmod p$ and $y^2 = a pmod p$ then
                          $$x^2 - y^2 = 0 pmod p,$$
                          $$(x+y)(x-y) = 0 pmod p,$$
                          that is $y = x pmod p$ or $y = -x pmod p$.


                        3. This means that there may be more solutions like $x+p, x+2p, ldots$, but at most two modulo $p$.



                        Cheers!






                        share|cite|improve this answer











                        $endgroup$













                        • $begingroup$
                          Thanks. what is mean $p-x ne x$ .can you explain more about this.
                          $endgroup$
                          – World
                          Dec 7 '12 at 17:51










                        • $begingroup$
                          We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
                          $endgroup$
                          – dtldarek
                          Dec 7 '12 at 18:22
















                        1












                        $begingroup$


                        1. If there is solution, then there is a second (different).
                          Observe that $$(p-x)^2 = x^2 - 2px + p^2,$$ so $$(p-x)^2 = x^2 pmod p.$$
                          Now assume that $x = p-x$, then $p = 2x$ and $p$ would be even (contradiction), so $x neq p-x$.


                        2. There are at most two different solutions modulo $p$.
                          Let $x^2 = a pmod p$ and $y^2 = a pmod p$ then
                          $$x^2 - y^2 = 0 pmod p,$$
                          $$(x+y)(x-y) = 0 pmod p,$$
                          that is $y = x pmod p$ or $y = -x pmod p$.


                        3. This means that there may be more solutions like $x+p, x+2p, ldots$, but at most two modulo $p$.



                        Cheers!






                        share|cite|improve this answer











                        $endgroup$













                        • $begingroup$
                          Thanks. what is mean $p-x ne x$ .can you explain more about this.
                          $endgroup$
                          – World
                          Dec 7 '12 at 17:51










                        • $begingroup$
                          We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
                          $endgroup$
                          – dtldarek
                          Dec 7 '12 at 18:22














                        1












                        1








                        1





                        $begingroup$


                        1. If there is solution, then there is a second (different).
                          Observe that $$(p-x)^2 = x^2 - 2px + p^2,$$ so $$(p-x)^2 = x^2 pmod p.$$
                          Now assume that $x = p-x$, then $p = 2x$ and $p$ would be even (contradiction), so $x neq p-x$.


                        2. There are at most two different solutions modulo $p$.
                          Let $x^2 = a pmod p$ and $y^2 = a pmod p$ then
                          $$x^2 - y^2 = 0 pmod p,$$
                          $$(x+y)(x-y) = 0 pmod p,$$
                          that is $y = x pmod p$ or $y = -x pmod p$.


                        3. This means that there may be more solutions like $x+p, x+2p, ldots$, but at most two modulo $p$.



                        Cheers!






                        share|cite|improve this answer











                        $endgroup$




                        1. If there is solution, then there is a second (different).
                          Observe that $$(p-x)^2 = x^2 - 2px + p^2,$$ so $$(p-x)^2 = x^2 pmod p.$$
                          Now assume that $x = p-x$, then $p = 2x$ and $p$ would be even (contradiction), so $x neq p-x$.


                        2. There are at most two different solutions modulo $p$.
                          Let $x^2 = a pmod p$ and $y^2 = a pmod p$ then
                          $$x^2 - y^2 = 0 pmod p,$$
                          $$(x+y)(x-y) = 0 pmod p,$$
                          that is $y = x pmod p$ or $y = -x pmod p$.


                        3. This means that there may be more solutions like $x+p, x+2p, ldots$, but at most two modulo $p$.



                        Cheers!







                        share|cite|improve this answer














                        share|cite|improve this answer



                        share|cite|improve this answer








                        edited Dec 7 '12 at 18:17

























                        answered Dec 7 '12 at 17:23









                        dtldarekdtldarek

                        32.2k743100




                        32.2k743100












                        • $begingroup$
                          Thanks. what is mean $p-x ne x$ .can you explain more about this.
                          $endgroup$
                          – World
                          Dec 7 '12 at 17:51










                        • $begingroup$
                          We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
                          $endgroup$
                          – dtldarek
                          Dec 7 '12 at 18:22


















                        • $begingroup$
                          Thanks. what is mean $p-x ne x$ .can you explain more about this.
                          $endgroup$
                          – World
                          Dec 7 '12 at 17:51










                        • $begingroup$
                          We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
                          $endgroup$
                          – dtldarek
                          Dec 7 '12 at 18:22
















                        $begingroup$
                        Thanks. what is mean $p-x ne x$ .can you explain more about this.
                        $endgroup$
                        – World
                        Dec 7 '12 at 17:51




                        $begingroup$
                        Thanks. what is mean $p-x ne x$ .can you explain more about this.
                        $endgroup$
                        – World
                        Dec 7 '12 at 17:51












                        $begingroup$
                        We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
                        $endgroup$
                        – dtldarek
                        Dec 7 '12 at 18:22




                        $begingroup$
                        We proved that there is possibly a second solution. The problem is, what if the two solutions $x$ and $p-x$ coincide, i.e. $x = p-x$ (we would have only one solution then)? However, this would imply that $p$ is even and contradict the assumption that $p$ is odd, therefore it is impossible that $x = p - x$ and therefore $x neq p - x$. Also, $a neq 0 pmod p$, so $x$ does not divide $p$ and therefore we have at least two different solutions.
                        $endgroup$
                        – dtldarek
                        Dec 7 '12 at 18:22











                        0












                        $begingroup$

                        When you are working mod $p$, you are actually working in the field $mathbb{Z}/pmathbb{Z} = mathbb{F}_p$. So, your statement translates to whether a polynomial of degree $2$ has roots in $mathbb{F}_p$ (which is not guaranteed because $mathbb{F}_p$ is not algebraically closed), and if it does have a root, how many roots can it have in total (namely $2$, because any quadratic polynomial has at most $2$ roots in any field, and if one root of a quadratic polynomial is in the field, the other root must also be in the field).






                        share|cite|improve this answer









                        $endgroup$


















                          0












                          $begingroup$

                          When you are working mod $p$, you are actually working in the field $mathbb{Z}/pmathbb{Z} = mathbb{F}_p$. So, your statement translates to whether a polynomial of degree $2$ has roots in $mathbb{F}_p$ (which is not guaranteed because $mathbb{F}_p$ is not algebraically closed), and if it does have a root, how many roots can it have in total (namely $2$, because any quadratic polynomial has at most $2$ roots in any field, and if one root of a quadratic polynomial is in the field, the other root must also be in the field).






                          share|cite|improve this answer









                          $endgroup$
















                            0












                            0








                            0





                            $begingroup$

                            When you are working mod $p$, you are actually working in the field $mathbb{Z}/pmathbb{Z} = mathbb{F}_p$. So, your statement translates to whether a polynomial of degree $2$ has roots in $mathbb{F}_p$ (which is not guaranteed because $mathbb{F}_p$ is not algebraically closed), and if it does have a root, how many roots can it have in total (namely $2$, because any quadratic polynomial has at most $2$ roots in any field, and if one root of a quadratic polynomial is in the field, the other root must also be in the field).






                            share|cite|improve this answer









                            $endgroup$



                            When you are working mod $p$, you are actually working in the field $mathbb{Z}/pmathbb{Z} = mathbb{F}_p$. So, your statement translates to whether a polynomial of degree $2$ has roots in $mathbb{F}_p$ (which is not guaranteed because $mathbb{F}_p$ is not algebraically closed), and if it does have a root, how many roots can it have in total (namely $2$, because any quadratic polynomial has at most $2$ roots in any field, and if one root of a quadratic polynomial is in the field, the other root must also be in the field).







                            share|cite|improve this answer












                            share|cite|improve this answer



                            share|cite|improve this answer










                            answered Dec 7 '12 at 17:25









                            RankeyaRankeya

                            6,22511351




                            6,22511351























                                0












                                $begingroup$

                                $$x^2=apmod pLongleftrightarrow (-x)^2=apmod p$$



                                and since $,p,$ is an odd prime, $,xneq -x,$ whenever $,xneq 0,$






                                share|cite|improve this answer











                                $endgroup$


















                                  0












                                  $begingroup$

                                  $$x^2=apmod pLongleftrightarrow (-x)^2=apmod p$$



                                  and since $,p,$ is an odd prime, $,xneq -x,$ whenever $,xneq 0,$






                                  share|cite|improve this answer











                                  $endgroup$
















                                    0












                                    0








                                    0





                                    $begingroup$

                                    $$x^2=apmod pLongleftrightarrow (-x)^2=apmod p$$



                                    and since $,p,$ is an odd prime, $,xneq -x,$ whenever $,xneq 0,$






                                    share|cite|improve this answer











                                    $endgroup$



                                    $$x^2=apmod pLongleftrightarrow (-x)^2=apmod p$$



                                    and since $,p,$ is an odd prime, $,xneq -x,$ whenever $,xneq 0,$







                                    share|cite|improve this answer














                                    share|cite|improve this answer



                                    share|cite|improve this answer








                                    edited Jan 6 at 20:44

























                                    answered Dec 7 '12 at 17:07









                                    DonAntonioDonAntonio

                                    177k1492225




                                    177k1492225






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Mathematics Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        Use MathJax to format equations. MathJax reference.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f253168%2fhow-to-prove-that-the-number-of-solutions-of-x2-equiv-a-pmodp-is-0-or-2%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Mario Kart Wii

                                        The Binding of Isaac: Rebirth/Afterbirth

                                        What does “Dominus providebit” mean?