Find $7^{2018}-1 bmod 5$ using Fermat's Little Theorem












1












$begingroup$


Let $z=7^{2018}-1$




Theorem. : Let $p in mathbb{N}$ be any prime and $a in mathbb{Z}$. If $p$ doesn't divide $a$, then $p$ divides $a^{p-1}-1$




$$
z=left(7^{1009}right)^2-1=left(7^{1009}right)^{3-1}-1
$$

For $p=3$ and $a=7^{1009}$ the theorem gives:
$$
z bmod 3=0
$$

Any hints on how to proceed to find $z bmod 5$?





Note: Some kind of error occurred and the important part of the last sentence got deleted/never composed. I apologize for the ambiguity of my question in its previous form.










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    I think you mean "if $p$ doesn't divide $a$". But why are you working $pmod 3$ when the question is asking about $pmod 5$?
    $endgroup$
    – lulu
    Dec 15 '18 at 13:38






  • 1




    $begingroup$
    Also a duplicate of this.
    $endgroup$
    – Jyrki Lahtonen
    Dec 15 '18 at 13:49
















1












$begingroup$


Let $z=7^{2018}-1$




Theorem. : Let $p in mathbb{N}$ be any prime and $a in mathbb{Z}$. If $p$ doesn't divide $a$, then $p$ divides $a^{p-1}-1$




$$
z=left(7^{1009}right)^2-1=left(7^{1009}right)^{3-1}-1
$$

For $p=3$ and $a=7^{1009}$ the theorem gives:
$$
z bmod 3=0
$$

Any hints on how to proceed to find $z bmod 5$?





Note: Some kind of error occurred and the important part of the last sentence got deleted/never composed. I apologize for the ambiguity of my question in its previous form.










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    I think you mean "if $p$ doesn't divide $a$". But why are you working $pmod 3$ when the question is asking about $pmod 5$?
    $endgroup$
    – lulu
    Dec 15 '18 at 13:38






  • 1




    $begingroup$
    Also a duplicate of this.
    $endgroup$
    – Jyrki Lahtonen
    Dec 15 '18 at 13:49














1












1








1





$begingroup$


Let $z=7^{2018}-1$




Theorem. : Let $p in mathbb{N}$ be any prime and $a in mathbb{Z}$. If $p$ doesn't divide $a$, then $p$ divides $a^{p-1}-1$




$$
z=left(7^{1009}right)^2-1=left(7^{1009}right)^{3-1}-1
$$

For $p=3$ and $a=7^{1009}$ the theorem gives:
$$
z bmod 3=0
$$

Any hints on how to proceed to find $z bmod 5$?





Note: Some kind of error occurred and the important part of the last sentence got deleted/never composed. I apologize for the ambiguity of my question in its previous form.










share|cite|improve this question











$endgroup$




Let $z=7^{2018}-1$




Theorem. : Let $p in mathbb{N}$ be any prime and $a in mathbb{Z}$. If $p$ doesn't divide $a$, then $p$ divides $a^{p-1}-1$




$$
z=left(7^{1009}right)^2-1=left(7^{1009}right)^{3-1}-1
$$

For $p=3$ and $a=7^{1009}$ the theorem gives:
$$
z bmod 3=0
$$

Any hints on how to proceed to find $z bmod 5$?





Note: Some kind of error occurred and the important part of the last sentence got deleted/never composed. I apologize for the ambiguity of my question in its previous form.







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 15 '18 at 17:22







Jevaut

















asked Dec 15 '18 at 13:36









JevautJevaut

1,156112




1,156112








  • 2




    $begingroup$
    I think you mean "if $p$ doesn't divide $a$". But why are you working $pmod 3$ when the question is asking about $pmod 5$?
    $endgroup$
    – lulu
    Dec 15 '18 at 13:38






  • 1




    $begingroup$
    Also a duplicate of this.
    $endgroup$
    – Jyrki Lahtonen
    Dec 15 '18 at 13:49














  • 2




    $begingroup$
    I think you mean "if $p$ doesn't divide $a$". But why are you working $pmod 3$ when the question is asking about $pmod 5$?
    $endgroup$
    – lulu
    Dec 15 '18 at 13:38






  • 1




    $begingroup$
    Also a duplicate of this.
    $endgroup$
    – Jyrki Lahtonen
    Dec 15 '18 at 13:49








2




2




$begingroup$
I think you mean "if $p$ doesn't divide $a$". But why are you working $pmod 3$ when the question is asking about $pmod 5$?
$endgroup$
– lulu
Dec 15 '18 at 13:38




$begingroup$
I think you mean "if $p$ doesn't divide $a$". But why are you working $pmod 3$ when the question is asking about $pmod 5$?
$endgroup$
– lulu
Dec 15 '18 at 13:38




1




1




$begingroup$
Also a duplicate of this.
$endgroup$
– Jyrki Lahtonen
Dec 15 '18 at 13:49




$begingroup$
Also a duplicate of this.
$endgroup$
– Jyrki Lahtonen
Dec 15 '18 at 13:49










3 Answers
3






active

oldest

votes


















1












$begingroup$


Any hints on how to proceed to find zmod5?




Do it the EXACT same way.



$5 -1 = X$



And $2018div X = Q$ with $R$ remaider.



So $7^{2018}-1 = (7^{Q})^X*7^R - 1 equiv 7^R - 1 pmod 5$.



Figuring $7^R-1$ can be done by hand as $7equiv 2pmod 5$ so $7^Requiv 2^Rpmod 7$ and $R < 5$.



.....



But I do have advice: Don't to $7^{2018} - 1 = (7^{2018})^2 - 1 equiv 1-1 equiv 0 pmod 3$. Do $7^{2018} -1 = (7^2)^{2018} - 1 equiv 1^{2018} - 1equiv 0 pmod 3$. It'll make things easier when $2018div (p-1)$ has a remainder (as it does with $p = 5$)






share|cite|improve this answer









$endgroup$





















    2












    $begingroup$

    We have:
    $$(7^2)^{1009} - 1 pmod 5$$
    $$equiv (-1)^{1009} - 1$$
    $$equiv -2 equiv bbox[5px,border:2px solid black]3 pmod 5$$






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      @BillDubuque Thanks!
      $endgroup$
      – Toby Mak
      Dec 15 '18 at 14:07










    • $begingroup$
      Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
      $endgroup$
      – Jevaut
      Dec 15 '18 at 15:21












    • $begingroup$
      "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
      $endgroup$
      – fleablood
      Dec 15 '18 at 17:38



















    1












    $begingroup$

    $7^{5-1}≡1mod 5$$7^{2016}=(7^4)^{504} ≡1mod 5$



    $7^2=49 ≡-1mod 5$



    $7^{2}.7^{2016}=7^{2018} ≡-1mod 5$



    $2^{2018}-1≡-2mod 5 ≡3mod 5$






    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%2f3041503%2ffind-72018-1-bmod-5-using-fermats-little-theorem%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1












      $begingroup$


      Any hints on how to proceed to find zmod5?




      Do it the EXACT same way.



      $5 -1 = X$



      And $2018div X = Q$ with $R$ remaider.



      So $7^{2018}-1 = (7^{Q})^X*7^R - 1 equiv 7^R - 1 pmod 5$.



      Figuring $7^R-1$ can be done by hand as $7equiv 2pmod 5$ so $7^Requiv 2^Rpmod 7$ and $R < 5$.



      .....



      But I do have advice: Don't to $7^{2018} - 1 = (7^{2018})^2 - 1 equiv 1-1 equiv 0 pmod 3$. Do $7^{2018} -1 = (7^2)^{2018} - 1 equiv 1^{2018} - 1equiv 0 pmod 3$. It'll make things easier when $2018div (p-1)$ has a remainder (as it does with $p = 5$)






      share|cite|improve this answer









      $endgroup$


















        1












        $begingroup$


        Any hints on how to proceed to find zmod5?




        Do it the EXACT same way.



        $5 -1 = X$



        And $2018div X = Q$ with $R$ remaider.



        So $7^{2018}-1 = (7^{Q})^X*7^R - 1 equiv 7^R - 1 pmod 5$.



        Figuring $7^R-1$ can be done by hand as $7equiv 2pmod 5$ so $7^Requiv 2^Rpmod 7$ and $R < 5$.



        .....



        But I do have advice: Don't to $7^{2018} - 1 = (7^{2018})^2 - 1 equiv 1-1 equiv 0 pmod 3$. Do $7^{2018} -1 = (7^2)^{2018} - 1 equiv 1^{2018} - 1equiv 0 pmod 3$. It'll make things easier when $2018div (p-1)$ has a remainder (as it does with $p = 5$)






        share|cite|improve this answer









        $endgroup$
















          1












          1








          1





          $begingroup$


          Any hints on how to proceed to find zmod5?




          Do it the EXACT same way.



          $5 -1 = X$



          And $2018div X = Q$ with $R$ remaider.



          So $7^{2018}-1 = (7^{Q})^X*7^R - 1 equiv 7^R - 1 pmod 5$.



          Figuring $7^R-1$ can be done by hand as $7equiv 2pmod 5$ so $7^Requiv 2^Rpmod 7$ and $R < 5$.



          .....



          But I do have advice: Don't to $7^{2018} - 1 = (7^{2018})^2 - 1 equiv 1-1 equiv 0 pmod 3$. Do $7^{2018} -1 = (7^2)^{2018} - 1 equiv 1^{2018} - 1equiv 0 pmod 3$. It'll make things easier when $2018div (p-1)$ has a remainder (as it does with $p = 5$)






          share|cite|improve this answer









          $endgroup$




          Any hints on how to proceed to find zmod5?




          Do it the EXACT same way.



          $5 -1 = X$



          And $2018div X = Q$ with $R$ remaider.



          So $7^{2018}-1 = (7^{Q})^X*7^R - 1 equiv 7^R - 1 pmod 5$.



          Figuring $7^R-1$ can be done by hand as $7equiv 2pmod 5$ so $7^Requiv 2^Rpmod 7$ and $R < 5$.



          .....



          But I do have advice: Don't to $7^{2018} - 1 = (7^{2018})^2 - 1 equiv 1-1 equiv 0 pmod 3$. Do $7^{2018} -1 = (7^2)^{2018} - 1 equiv 1^{2018} - 1equiv 0 pmod 3$. It'll make things easier when $2018div (p-1)$ has a remainder (as it does with $p = 5$)







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 15 '18 at 17:30









          fleabloodfleablood

          70.5k22685




          70.5k22685























              2












              $begingroup$

              We have:
              $$(7^2)^{1009} - 1 pmod 5$$
              $$equiv (-1)^{1009} - 1$$
              $$equiv -2 equiv bbox[5px,border:2px solid black]3 pmod 5$$






              share|cite|improve this answer











              $endgroup$













              • $begingroup$
                @BillDubuque Thanks!
                $endgroup$
                – Toby Mak
                Dec 15 '18 at 14:07










              • $begingroup$
                Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
                $endgroup$
                – Jevaut
                Dec 15 '18 at 15:21












              • $begingroup$
                "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
                $endgroup$
                – fleablood
                Dec 15 '18 at 17:38
















              2












              $begingroup$

              We have:
              $$(7^2)^{1009} - 1 pmod 5$$
              $$equiv (-1)^{1009} - 1$$
              $$equiv -2 equiv bbox[5px,border:2px solid black]3 pmod 5$$






              share|cite|improve this answer











              $endgroup$













              • $begingroup$
                @BillDubuque Thanks!
                $endgroup$
                – Toby Mak
                Dec 15 '18 at 14:07










              • $begingroup$
                Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
                $endgroup$
                – Jevaut
                Dec 15 '18 at 15:21












              • $begingroup$
                "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
                $endgroup$
                – fleablood
                Dec 15 '18 at 17:38














              2












              2








              2





              $begingroup$

              We have:
              $$(7^2)^{1009} - 1 pmod 5$$
              $$equiv (-1)^{1009} - 1$$
              $$equiv -2 equiv bbox[5px,border:2px solid black]3 pmod 5$$






              share|cite|improve this answer











              $endgroup$



              We have:
              $$(7^2)^{1009} - 1 pmod 5$$
              $$equiv (-1)^{1009} - 1$$
              $$equiv -2 equiv bbox[5px,border:2px solid black]3 pmod 5$$







              share|cite|improve this answer














              share|cite|improve this answer



              share|cite|improve this answer








              edited Dec 15 '18 at 14:06

























              answered Dec 15 '18 at 13:46









              Toby MakToby Mak

              3,49811128




              3,49811128












              • $begingroup$
                @BillDubuque Thanks!
                $endgroup$
                – Toby Mak
                Dec 15 '18 at 14:07










              • $begingroup$
                Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
                $endgroup$
                – Jevaut
                Dec 15 '18 at 15:21












              • $begingroup$
                "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
                $endgroup$
                – fleablood
                Dec 15 '18 at 17:38


















              • $begingroup$
                @BillDubuque Thanks!
                $endgroup$
                – Toby Mak
                Dec 15 '18 at 14:07










              • $begingroup$
                Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
                $endgroup$
                – Jevaut
                Dec 15 '18 at 15:21












              • $begingroup$
                "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
                $endgroup$
                – fleablood
                Dec 15 '18 at 17:38
















              $begingroup$
              @BillDubuque Thanks!
              $endgroup$
              – Toby Mak
              Dec 15 '18 at 14:07




              $begingroup$
              @BillDubuque Thanks!
              $endgroup$
              – Toby Mak
              Dec 15 '18 at 14:07












              $begingroup$
              Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
              $endgroup$
              – Jevaut
              Dec 15 '18 at 15:21






              $begingroup$
              Is $a^n equiv (a bmod 5)^n , , (bmod 5)$ a general rule?
              $endgroup$
              – Jevaut
              Dec 15 '18 at 15:21














              $begingroup$
              "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
              $endgroup$
              – fleablood
              Dec 15 '18 at 17:38




              $begingroup$
              "Is an≡(amod5)n(mod5) a general rule?" Yes. Arithmetic (addition, subtraction, multiplication, and raising things to powers) distributes over modulo. (Although division requires care; and being powers absolutely does not). That's a very basic fact you should have proven for yourself long before learning FLT.
              $endgroup$
              – fleablood
              Dec 15 '18 at 17:38











              1












              $begingroup$

              $7^{5-1}≡1mod 5$$7^{2016}=(7^4)^{504} ≡1mod 5$



              $7^2=49 ≡-1mod 5$



              $7^{2}.7^{2016}=7^{2018} ≡-1mod 5$



              $2^{2018}-1≡-2mod 5 ≡3mod 5$






              share|cite|improve this answer









              $endgroup$


















                1












                $begingroup$

                $7^{5-1}≡1mod 5$$7^{2016}=(7^4)^{504} ≡1mod 5$



                $7^2=49 ≡-1mod 5$



                $7^{2}.7^{2016}=7^{2018} ≡-1mod 5$



                $2^{2018}-1≡-2mod 5 ≡3mod 5$






                share|cite|improve this answer









                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  $7^{5-1}≡1mod 5$$7^{2016}=(7^4)^{504} ≡1mod 5$



                  $7^2=49 ≡-1mod 5$



                  $7^{2}.7^{2016}=7^{2018} ≡-1mod 5$



                  $2^{2018}-1≡-2mod 5 ≡3mod 5$






                  share|cite|improve this answer









                  $endgroup$



                  $7^{5-1}≡1mod 5$$7^{2016}=(7^4)^{504} ≡1mod 5$



                  $7^2=49 ≡-1mod 5$



                  $7^{2}.7^{2016}=7^{2018} ≡-1mod 5$



                  $2^{2018}-1≡-2mod 5 ≡3mod 5$







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 15 '18 at 17:59









                  siroussirous

                  1,6611514




                  1,6611514






























                      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%2f3041503%2ffind-72018-1-bmod-5-using-fermats-little-theorem%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

                      Quarter-circle Tiles

                      build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                      Mont Emei