When for given $p$ and $n$ we have $p^n pmod{4}=1$?












1














Consider $p$ is a prime odd number and $n$ is an integer positive number.



My question: Is there a condition over parameters $p$ and $n$ such that
$p^n equiv1pmod{4}$ ?



Thanks for any suggestions.










share|cite|improve this question





























    1














    Consider $p$ is a prime odd number and $n$ is an integer positive number.



    My question: Is there a condition over parameters $p$ and $n$ such that
    $p^n equiv1pmod{4}$ ?



    Thanks for any suggestions.










    share|cite|improve this question



























      1












      1








      1







      Consider $p$ is a prime odd number and $n$ is an integer positive number.



      My question: Is there a condition over parameters $p$ and $n$ such that
      $p^n equiv1pmod{4}$ ?



      Thanks for any suggestions.










      share|cite|improve this question















      Consider $p$ is a prime odd number and $n$ is an integer positive number.



      My question: Is there a condition over parameters $p$ and $n$ such that
      $p^n equiv1pmod{4}$ ?



      Thanks for any suggestions.







      elementary-number-theory






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 1 at 17:19









      Yadati Kiran

      1,702519




      1,702519










      asked Dec 1 at 17:14









      user0410

      1898




      1898






















          1 Answer
          1






          active

          oldest

          votes


















          5














          Since $p$ is odd, either $p = 4k+1$ or $p=4k-1$ for some $k$. Applying the binomial theorem, we see that in the former case,
          $$ p^n = (4k+1)^n = 1+ sum_{j=1}^n binom{n}{j} (4k)^j equiv 1 , (text{mod } 4), $$
          so the required condition holds for all such primes.
          In the latter case,
          $$ p^n = (4k-1)^n = (-1)^n + sum_{j=1}^n binom{n}{j} (4k)^j (-1)^{n-j} equiv (-1)^n , (text{mod } 4), $$
          so $n$ should be even.






          share|cite|improve this answer





















          • I would very much appreciate for your nice solution.
            – user0410
            Dec 1 at 17:27






          • 1




            @user0410 Glad that it helped!
            – MisterRiemann
            Dec 1 at 17:29






          • 2




            If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
            – Keith Backman
            Dec 2 at 3:09










          • @KeithBackman Good point, not really sure how I managed to miss that!
            – MisterRiemann
            Dec 2 at 9:27











          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%2f3021582%2fwhen-for-given-p-and-n-we-have-pn-pmod4-1%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          Since $p$ is odd, either $p = 4k+1$ or $p=4k-1$ for some $k$. Applying the binomial theorem, we see that in the former case,
          $$ p^n = (4k+1)^n = 1+ sum_{j=1}^n binom{n}{j} (4k)^j equiv 1 , (text{mod } 4), $$
          so the required condition holds for all such primes.
          In the latter case,
          $$ p^n = (4k-1)^n = (-1)^n + sum_{j=1}^n binom{n}{j} (4k)^j (-1)^{n-j} equiv (-1)^n , (text{mod } 4), $$
          so $n$ should be even.






          share|cite|improve this answer





















          • I would very much appreciate for your nice solution.
            – user0410
            Dec 1 at 17:27






          • 1




            @user0410 Glad that it helped!
            – MisterRiemann
            Dec 1 at 17:29






          • 2




            If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
            – Keith Backman
            Dec 2 at 3:09










          • @KeithBackman Good point, not really sure how I managed to miss that!
            – MisterRiemann
            Dec 2 at 9:27
















          5














          Since $p$ is odd, either $p = 4k+1$ or $p=4k-1$ for some $k$. Applying the binomial theorem, we see that in the former case,
          $$ p^n = (4k+1)^n = 1+ sum_{j=1}^n binom{n}{j} (4k)^j equiv 1 , (text{mod } 4), $$
          so the required condition holds for all such primes.
          In the latter case,
          $$ p^n = (4k-1)^n = (-1)^n + sum_{j=1}^n binom{n}{j} (4k)^j (-1)^{n-j} equiv (-1)^n , (text{mod } 4), $$
          so $n$ should be even.






          share|cite|improve this answer





















          • I would very much appreciate for your nice solution.
            – user0410
            Dec 1 at 17:27






          • 1




            @user0410 Glad that it helped!
            – MisterRiemann
            Dec 1 at 17:29






          • 2




            If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
            – Keith Backman
            Dec 2 at 3:09










          • @KeithBackman Good point, not really sure how I managed to miss that!
            – MisterRiemann
            Dec 2 at 9:27














          5












          5








          5






          Since $p$ is odd, either $p = 4k+1$ or $p=4k-1$ for some $k$. Applying the binomial theorem, we see that in the former case,
          $$ p^n = (4k+1)^n = 1+ sum_{j=1}^n binom{n}{j} (4k)^j equiv 1 , (text{mod } 4), $$
          so the required condition holds for all such primes.
          In the latter case,
          $$ p^n = (4k-1)^n = (-1)^n + sum_{j=1}^n binom{n}{j} (4k)^j (-1)^{n-j} equiv (-1)^n , (text{mod } 4), $$
          so $n$ should be even.






          share|cite|improve this answer












          Since $p$ is odd, either $p = 4k+1$ or $p=4k-1$ for some $k$. Applying the binomial theorem, we see that in the former case,
          $$ p^n = (4k+1)^n = 1+ sum_{j=1}^n binom{n}{j} (4k)^j equiv 1 , (text{mod } 4), $$
          so the required condition holds for all such primes.
          In the latter case,
          $$ p^n = (4k-1)^n = (-1)^n + sum_{j=1}^n binom{n}{j} (4k)^j (-1)^{n-j} equiv (-1)^n , (text{mod } 4), $$
          so $n$ should be even.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 1 at 17:19









          MisterRiemann

          5,7691624




          5,7691624












          • I would very much appreciate for your nice solution.
            – user0410
            Dec 1 at 17:27






          • 1




            @user0410 Glad that it helped!
            – MisterRiemann
            Dec 1 at 17:29






          • 2




            If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
            – Keith Backman
            Dec 2 at 3:09










          • @KeithBackman Good point, not really sure how I managed to miss that!
            – MisterRiemann
            Dec 2 at 9:27


















          • I would very much appreciate for your nice solution.
            – user0410
            Dec 1 at 17:27






          • 1




            @user0410 Glad that it helped!
            – MisterRiemann
            Dec 1 at 17:29






          • 2




            If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
            – Keith Backman
            Dec 2 at 3:09










          • @KeithBackman Good point, not really sure how I managed to miss that!
            – MisterRiemann
            Dec 2 at 9:27
















          I would very much appreciate for your nice solution.
          – user0410
          Dec 1 at 17:27




          I would very much appreciate for your nice solution.
          – user0410
          Dec 1 at 17:27




          1




          1




          @user0410 Glad that it helped!
          – MisterRiemann
          Dec 1 at 17:29




          @user0410 Glad that it helped!
          – MisterRiemann
          Dec 1 at 17:29




          2




          2




          If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
          – Keith Backman
          Dec 2 at 3:09




          If you reduce the prime $mod{4}$ prior to exponentiation, you can avoid the need for the binomial expansion. $pequiv pm1 mod{4}$, so $p^nequiv (pm1)^nmod{4}$. Keeping proper track of the $pm$ signs, you get the result given by MisterRiemann.
          – Keith Backman
          Dec 2 at 3:09












          @KeithBackman Good point, not really sure how I managed to miss that!
          – MisterRiemann
          Dec 2 at 9:27




          @KeithBackman Good point, not really sure how I managed to miss that!
          – MisterRiemann
          Dec 2 at 9:27


















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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.


          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%2f3021582%2fwhen-for-given-p-and-n-we-have-pn-pmod4-1%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

          Sphinx de Gizeh

          Dijon

          Équipe cycliste