Use Fermat's Theorem to prove 10001 is composite











up vote
4
down vote

favorite












I need to use Fermat's Theorem to prove that 10001 is not prime. I understand that I just need to find a counterexample where $a^{10000}$ mod 10001 = 1 mod 10001 does not hold true, but this seems kind of difficult with such large numbers. Any ideas?










share|cite|improve this question




























    up vote
    4
    down vote

    favorite












    I need to use Fermat's Theorem to prove that 10001 is not prime. I understand that I just need to find a counterexample where $a^{10000}$ mod 10001 = 1 mod 10001 does not hold true, but this seems kind of difficult with such large numbers. Any ideas?










    share|cite|improve this question


























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I need to use Fermat's Theorem to prove that 10001 is not prime. I understand that I just need to find a counterexample where $a^{10000}$ mod 10001 = 1 mod 10001 does not hold true, but this seems kind of difficult with such large numbers. Any ideas?










      share|cite|improve this question















      I need to use Fermat's Theorem to prove that 10001 is not prime. I understand that I just need to find a counterexample where $a^{10000}$ mod 10001 = 1 mod 10001 does not hold true, but this seems kind of difficult with such large numbers. Any ideas?







      prime-numbers






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited 5 hours ago









      Geneten48

      596




      596










      asked 6 hours ago









      katie

      233




      233






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          Fermat pseudoprimes to any given base are really very rare, so you might as well just launch in with $2$ and hope for the best. This is a bit tedious but perfectly doable by repeated squaring:
          $$10000 = 2^{13}+2^{10}+2^9+2^8+2^4$$
          so you just need to keep on squaring $2$ (modulo $10001$) thirteen times.






          share|cite|improve this answer




























            up vote
            2
            down vote













            This is a bit of a cheat, but another theorem of Fermat's says that $10001$ cannot be prime because it has two different representations as a sum of two squares:



            $$10001=100^2+1^2=65^2+76^2$$



            The "cheat" here is that, while $100^2+1^2$ is easy enough to spot, finding the other sum of two squares involved almost as much work as searching for the factors themselves would have taken.






            share|cite|improve this answer





















            • It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
              – Bill Dubuque
              4 hours ago










            • @BillDubuque, agreed. Nice way to get the factors.
              – Barry Cipra
              3 hours ago


















            up vote
            2
            down vote













            Another method, also based on Fermat's little theorem, is the following.



            First notice $$10001=10^4+1=frac{10^8-1}{10^4-1}$$



            So finding a prime factor of $10^8-1$ that is not also a factor of $10^4-1$ is enough. The prime factors of $10^4-1$ are easy to determine even by hand calculation : $3,11,101$
            Another prime dividing $10^8-1$ must be of the form $8k+1$



            This is because the smallest positive integer $k$ with $ 10^kequiv 1mod q $ (the order of $10$ modulo $q$) is $8$ and Fermat's little theorem gives $ 10^{q-1}equiv 1mod q $ which shows $8mid q-1$. So, we only need to verify the primes of the form $8k+1$. The first three are $17,41,73$



            $73$ turns out to divide $10001$ and proves that $10001$ is composite.



            For a bit larger numbers (but not too large) of a special form this method should be superior to the direct calculation of the power.






            share|cite|improve this answer





















              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',
              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%2f3020674%2fuse-fermats-theorem-to-prove-10001-is-composite%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








              up vote
              2
              down vote













              Fermat pseudoprimes to any given base are really very rare, so you might as well just launch in with $2$ and hope for the best. This is a bit tedious but perfectly doable by repeated squaring:
              $$10000 = 2^{13}+2^{10}+2^9+2^8+2^4$$
              so you just need to keep on squaring $2$ (modulo $10001$) thirteen times.






              share|cite|improve this answer

























                up vote
                2
                down vote













                Fermat pseudoprimes to any given base are really very rare, so you might as well just launch in with $2$ and hope for the best. This is a bit tedious but perfectly doable by repeated squaring:
                $$10000 = 2^{13}+2^{10}+2^9+2^8+2^4$$
                so you just need to keep on squaring $2$ (modulo $10001$) thirteen times.






                share|cite|improve this answer























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  Fermat pseudoprimes to any given base are really very rare, so you might as well just launch in with $2$ and hope for the best. This is a bit tedious but perfectly doable by repeated squaring:
                  $$10000 = 2^{13}+2^{10}+2^9+2^8+2^4$$
                  so you just need to keep on squaring $2$ (modulo $10001$) thirteen times.






                  share|cite|improve this answer












                  Fermat pseudoprimes to any given base are really very rare, so you might as well just launch in with $2$ and hope for the best. This is a bit tedious but perfectly doable by repeated squaring:
                  $$10000 = 2^{13}+2^{10}+2^9+2^8+2^4$$
                  so you just need to keep on squaring $2$ (modulo $10001$) thirteen times.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered 6 hours ago









                  Patrick Stevens

                  28.1k52874




                  28.1k52874






















                      up vote
                      2
                      down vote













                      This is a bit of a cheat, but another theorem of Fermat's says that $10001$ cannot be prime because it has two different representations as a sum of two squares:



                      $$10001=100^2+1^2=65^2+76^2$$



                      The "cheat" here is that, while $100^2+1^2$ is easy enough to spot, finding the other sum of two squares involved almost as much work as searching for the factors themselves would have taken.






                      share|cite|improve this answer





















                      • It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
                        – Bill Dubuque
                        4 hours ago










                      • @BillDubuque, agreed. Nice way to get the factors.
                        – Barry Cipra
                        3 hours ago















                      up vote
                      2
                      down vote













                      This is a bit of a cheat, but another theorem of Fermat's says that $10001$ cannot be prime because it has two different representations as a sum of two squares:



                      $$10001=100^2+1^2=65^2+76^2$$



                      The "cheat" here is that, while $100^2+1^2$ is easy enough to spot, finding the other sum of two squares involved almost as much work as searching for the factors themselves would have taken.






                      share|cite|improve this answer





















                      • It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
                        – Bill Dubuque
                        4 hours ago










                      • @BillDubuque, agreed. Nice way to get the factors.
                        – Barry Cipra
                        3 hours ago













                      up vote
                      2
                      down vote










                      up vote
                      2
                      down vote









                      This is a bit of a cheat, but another theorem of Fermat's says that $10001$ cannot be prime because it has two different representations as a sum of two squares:



                      $$10001=100^2+1^2=65^2+76^2$$



                      The "cheat" here is that, while $100^2+1^2$ is easy enough to spot, finding the other sum of two squares involved almost as much work as searching for the factors themselves would have taken.






                      share|cite|improve this answer












                      This is a bit of a cheat, but another theorem of Fermat's says that $10001$ cannot be prime because it has two different representations as a sum of two squares:



                      $$10001=100^2+1^2=65^2+76^2$$



                      The "cheat" here is that, while $100^2+1^2$ is easy enough to spot, finding the other sum of two squares involved almost as much work as searching for the factors themselves would have taken.







                      share|cite|improve this answer












                      share|cite|improve this answer



                      share|cite|improve this answer










                      answered 5 hours ago









                      Barry Cipra

                      58.3k652121




                      58.3k652121












                      • It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
                        – Bill Dubuque
                        4 hours ago










                      • @BillDubuque, agreed. Nice way to get the factors.
                        – Barry Cipra
                        3 hours ago


















                      • It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
                        – Bill Dubuque
                        4 hours ago










                      • @BillDubuque, agreed. Nice way to get the factors.
                        – Barry Cipra
                        3 hours ago
















                      It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
                      – Bill Dubuque
                      4 hours ago




                      It really is cheating - being at least as hard as factoring, since it immediately yields the factors via $ gcd(100001, 76 pm 65cdot 100) = 137,,73. $ Maybe that explains the downvote (not from me).
                      – Bill Dubuque
                      4 hours ago












                      @BillDubuque, agreed. Nice way to get the factors.
                      – Barry Cipra
                      3 hours ago




                      @BillDubuque, agreed. Nice way to get the factors.
                      – Barry Cipra
                      3 hours ago










                      up vote
                      2
                      down vote













                      Another method, also based on Fermat's little theorem, is the following.



                      First notice $$10001=10^4+1=frac{10^8-1}{10^4-1}$$



                      So finding a prime factor of $10^8-1$ that is not also a factor of $10^4-1$ is enough. The prime factors of $10^4-1$ are easy to determine even by hand calculation : $3,11,101$
                      Another prime dividing $10^8-1$ must be of the form $8k+1$



                      This is because the smallest positive integer $k$ with $ 10^kequiv 1mod q $ (the order of $10$ modulo $q$) is $8$ and Fermat's little theorem gives $ 10^{q-1}equiv 1mod q $ which shows $8mid q-1$. So, we only need to verify the primes of the form $8k+1$. The first three are $17,41,73$



                      $73$ turns out to divide $10001$ and proves that $10001$ is composite.



                      For a bit larger numbers (but not too large) of a special form this method should be superior to the direct calculation of the power.






                      share|cite|improve this answer

























                        up vote
                        2
                        down vote













                        Another method, also based on Fermat's little theorem, is the following.



                        First notice $$10001=10^4+1=frac{10^8-1}{10^4-1}$$



                        So finding a prime factor of $10^8-1$ that is not also a factor of $10^4-1$ is enough. The prime factors of $10^4-1$ are easy to determine even by hand calculation : $3,11,101$
                        Another prime dividing $10^8-1$ must be of the form $8k+1$



                        This is because the smallest positive integer $k$ with $ 10^kequiv 1mod q $ (the order of $10$ modulo $q$) is $8$ and Fermat's little theorem gives $ 10^{q-1}equiv 1mod q $ which shows $8mid q-1$. So, we only need to verify the primes of the form $8k+1$. The first three are $17,41,73$



                        $73$ turns out to divide $10001$ and proves that $10001$ is composite.



                        For a bit larger numbers (but not too large) of a special form this method should be superior to the direct calculation of the power.






                        share|cite|improve this answer























                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          Another method, also based on Fermat's little theorem, is the following.



                          First notice $$10001=10^4+1=frac{10^8-1}{10^4-1}$$



                          So finding a prime factor of $10^8-1$ that is not also a factor of $10^4-1$ is enough. The prime factors of $10^4-1$ are easy to determine even by hand calculation : $3,11,101$
                          Another prime dividing $10^8-1$ must be of the form $8k+1$



                          This is because the smallest positive integer $k$ with $ 10^kequiv 1mod q $ (the order of $10$ modulo $q$) is $8$ and Fermat's little theorem gives $ 10^{q-1}equiv 1mod q $ which shows $8mid q-1$. So, we only need to verify the primes of the form $8k+1$. The first three are $17,41,73$



                          $73$ turns out to divide $10001$ and proves that $10001$ is composite.



                          For a bit larger numbers (but not too large) of a special form this method should be superior to the direct calculation of the power.






                          share|cite|improve this answer












                          Another method, also based on Fermat's little theorem, is the following.



                          First notice $$10001=10^4+1=frac{10^8-1}{10^4-1}$$



                          So finding a prime factor of $10^8-1$ that is not also a factor of $10^4-1$ is enough. The prime factors of $10^4-1$ are easy to determine even by hand calculation : $3,11,101$
                          Another prime dividing $10^8-1$ must be of the form $8k+1$



                          This is because the smallest positive integer $k$ with $ 10^kequiv 1mod q $ (the order of $10$ modulo $q$) is $8$ and Fermat's little theorem gives $ 10^{q-1}equiv 1mod q $ which shows $8mid q-1$. So, we only need to verify the primes of the form $8k+1$. The first three are $17,41,73$



                          $73$ turns out to divide $10001$ and proves that $10001$ is composite.



                          For a bit larger numbers (but not too large) of a special form this method should be superior to the direct calculation of the power.







                          share|cite|improve this answer












                          share|cite|improve this answer



                          share|cite|improve this answer










                          answered 5 hours ago









                          Peter

                          46.2k1039125




                          46.2k1039125






























                              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%2f3020674%2fuse-fermats-theorem-to-prove-10001-is-composite%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

                              Eastern Orthodox Church

                              Understanding the information contained in the Deep Space Network XML data?

                              Zagreb