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 Nov 30 at 21:56









      Geneten48

      597




      597










      asked Nov 30 at 21:43









      katie

      263




      263






















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          4
          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
            3
            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
                Nov 30 at 23:47










              • @BillDubuque, agreed. Nice way to get the factors.
                – Barry Cipra
                Dec 1 at 0:02


















              up vote
              0
              down vote













              For 5-digit size of numbers you can still use Fermat's factorisation method and a difference of two squares. If your number $10001$ has got minimum of two factors, they won't be in such a great distance between each other. In this case it happened that only $5$ squares beginning from $100$ needed to be examined:



              $105^2-32^2=11025-1024=10001$



              So your solution is that $10001$ is a composite number with two prime factors:



              $(105+32)cdot(105-32)=137 cdot 73=10001$



              For very large numbers there is another method, however to long to describe in here, which results in:



              $10001= 3cdot3333+2=sum (5403+3333+1263)+2$



              In this 3-term arithmetic progression the difference between terms can be expressed:



              $d=2cdot xcdot y=2cdot1035=2cdot23cdot45$



              ... where $x$ and $y$ are variables of two prime numbers. Plugin them along with a leading coefficient number $3$ results in:



              $(3cdot23+4)(3cdot45+2)=73cdot137=10001$






              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

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                4
                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
                  4
                  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
                    4
                    down vote










                    up vote
                    4
                    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 Nov 30 at 22:42









                    Peter

                    46.4k1039125




                    46.4k1039125






















                        up vote
                        3
                        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
                          3
                          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
                            3
                            down vote










                            up vote
                            3
                            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 Nov 30 at 21:49









                            Patrick Stevens

                            28.2k52874




                            28.2k52874






















                                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
                                  Nov 30 at 23:47










                                • @BillDubuque, agreed. Nice way to get the factors.
                                  – Barry Cipra
                                  Dec 1 at 0:02















                                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
                                  Nov 30 at 23:47










                                • @BillDubuque, agreed. Nice way to get the factors.
                                  – Barry Cipra
                                  Dec 1 at 0:02













                                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 Nov 30 at 22:20









                                Barry Cipra

                                58.6k653122




                                58.6k653122












                                • 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
                                  Nov 30 at 23:47










                                • @BillDubuque, agreed. Nice way to get the factors.
                                  – Barry Cipra
                                  Dec 1 at 0:02


















                                • 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
                                  Nov 30 at 23:47










                                • @BillDubuque, agreed. Nice way to get the factors.
                                  – Barry Cipra
                                  Dec 1 at 0:02
















                                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
                                Nov 30 at 23:47




                                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
                                Nov 30 at 23:47












                                @BillDubuque, agreed. Nice way to get the factors.
                                – Barry Cipra
                                Dec 1 at 0:02




                                @BillDubuque, agreed. Nice way to get the factors.
                                – Barry Cipra
                                Dec 1 at 0:02










                                up vote
                                0
                                down vote













                                For 5-digit size of numbers you can still use Fermat's factorisation method and a difference of two squares. If your number $10001$ has got minimum of two factors, they won't be in such a great distance between each other. In this case it happened that only $5$ squares beginning from $100$ needed to be examined:



                                $105^2-32^2=11025-1024=10001$



                                So your solution is that $10001$ is a composite number with two prime factors:



                                $(105+32)cdot(105-32)=137 cdot 73=10001$



                                For very large numbers there is another method, however to long to describe in here, which results in:



                                $10001= 3cdot3333+2=sum (5403+3333+1263)+2$



                                In this 3-term arithmetic progression the difference between terms can be expressed:



                                $d=2cdot xcdot y=2cdot1035=2cdot23cdot45$



                                ... where $x$ and $y$ are variables of two prime numbers. Plugin them along with a leading coefficient number $3$ results in:



                                $(3cdot23+4)(3cdot45+2)=73cdot137=10001$






                                share|cite|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  For 5-digit size of numbers you can still use Fermat's factorisation method and a difference of two squares. If your number $10001$ has got minimum of two factors, they won't be in such a great distance between each other. In this case it happened that only $5$ squares beginning from $100$ needed to be examined:



                                  $105^2-32^2=11025-1024=10001$



                                  So your solution is that $10001$ is a composite number with two prime factors:



                                  $(105+32)cdot(105-32)=137 cdot 73=10001$



                                  For very large numbers there is another method, however to long to describe in here, which results in:



                                  $10001= 3cdot3333+2=sum (5403+3333+1263)+2$



                                  In this 3-term arithmetic progression the difference between terms can be expressed:



                                  $d=2cdot xcdot y=2cdot1035=2cdot23cdot45$



                                  ... where $x$ and $y$ are variables of two prime numbers. Plugin them along with a leading coefficient number $3$ results in:



                                  $(3cdot23+4)(3cdot45+2)=73cdot137=10001$






                                  share|cite|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    For 5-digit size of numbers you can still use Fermat's factorisation method and a difference of two squares. If your number $10001$ has got minimum of two factors, they won't be in such a great distance between each other. In this case it happened that only $5$ squares beginning from $100$ needed to be examined:



                                    $105^2-32^2=11025-1024=10001$



                                    So your solution is that $10001$ is a composite number with two prime factors:



                                    $(105+32)cdot(105-32)=137 cdot 73=10001$



                                    For very large numbers there is another method, however to long to describe in here, which results in:



                                    $10001= 3cdot3333+2=sum (5403+3333+1263)+2$



                                    In this 3-term arithmetic progression the difference between terms can be expressed:



                                    $d=2cdot xcdot y=2cdot1035=2cdot23cdot45$



                                    ... where $x$ and $y$ are variables of two prime numbers. Plugin them along with a leading coefficient number $3$ results in:



                                    $(3cdot23+4)(3cdot45+2)=73cdot137=10001$






                                    share|cite|improve this answer












                                    For 5-digit size of numbers you can still use Fermat's factorisation method and a difference of two squares. If your number $10001$ has got minimum of two factors, they won't be in such a great distance between each other. In this case it happened that only $5$ squares beginning from $100$ needed to be examined:



                                    $105^2-32^2=11025-1024=10001$



                                    So your solution is that $10001$ is a composite number with two prime factors:



                                    $(105+32)cdot(105-32)=137 cdot 73=10001$



                                    For very large numbers there is another method, however to long to describe in here, which results in:



                                    $10001= 3cdot3333+2=sum (5403+3333+1263)+2$



                                    In this 3-term arithmetic progression the difference between terms can be expressed:



                                    $d=2cdot xcdot y=2cdot1035=2cdot23cdot45$



                                    ... where $x$ and $y$ are variables of two prime numbers. Plugin them along with a leading coefficient number $3$ results in:



                                    $(3cdot23+4)(3cdot45+2)=73cdot137=10001$







                                    share|cite|improve this answer












                                    share|cite|improve this answer



                                    share|cite|improve this answer










                                    answered Dec 1 at 11:42









                                    usiro

                                    32539




                                    32539






























                                        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

                                        Quarter-circle Tiles

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

                                        Mont Emei