Find the values of $p$ and $q$












6















If $p^3+p=q^2+q$ where $p$ and $q$ are prime numbers,
Find all the solutions (p, q)




I tried to solve this exercise using that:



$p^2 = -1(text{mod} , q)$ and $q = -1(text{mod} , p)$;
So: $q+1=ap$ and $p^2+1=bq$, where $b$ and $q$ integers.



Then I tried to solve a quadratic equation, but I could not finish the problem










share|cite|improve this question





























    6















    If $p^3+p=q^2+q$ where $p$ and $q$ are prime numbers,
    Find all the solutions (p, q)




    I tried to solve this exercise using that:



    $p^2 = -1(text{mod} , q)$ and $q = -1(text{mod} , p)$;
    So: $q+1=ap$ and $p^2+1=bq$, where $b$ and $q$ integers.



    Then I tried to solve a quadratic equation, but I could not finish the problem










    share|cite|improve this question



























      6












      6








      6








      If $p^3+p=q^2+q$ where $p$ and $q$ are prime numbers,
      Find all the solutions (p, q)




      I tried to solve this exercise using that:



      $p^2 = -1(text{mod} , q)$ and $q = -1(text{mod} , p)$;
      So: $q+1=ap$ and $p^2+1=bq$, where $b$ and $q$ integers.



      Then I tried to solve a quadratic equation, but I could not finish the problem










      share|cite|improve this question
















      If $p^3+p=q^2+q$ where $p$ and $q$ are prime numbers,
      Find all the solutions (p, q)




      I tried to solve this exercise using that:



      $p^2 = -1(text{mod} , q)$ and $q = -1(text{mod} , p)$;
      So: $q+1=ap$ and $p^2+1=bq$, where $b$ and $q$ integers.



      Then I tried to solve a quadratic equation, but I could not finish the problem







      algebra-precalculus elementary-number-theory polynomials prime-numbers diophantine-equations






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 28 '18 at 1:50









      Servaes

      22.4k33793




      22.4k33793










      asked Oct 6 '18 at 18:43









      Matheus Domingos

      956




      956






















          4 Answers
          4






          active

          oldest

          votes


















          3














          Clearly $pneq q$, and because $p$ and $q$ are prime and
          $$p(p^2+1)=p^3+p=q^2+q=q(q+1),$$
          we must have $pmid q+1$ and $qmid p^2+1$. Write
          $$q+1=apqquadtext{ and }qquad p^2+1=bq,$$
          to find that $p^2-abp+b+1=0$. In particular $b+1equiv0pmod{p}$, say $b=cp-1$, but then
          $$p^2+1=(cp-1)q=(cp-1)(ap-1)=acp^2-(a+c)p+1.$$
          Note that $a$, $b$ and $c$ are positive integers, and that $a>1$ as otherwise $p=q+1$ which implies that $(p,q)=(3,2)$ which is not a solution. The equation above simplifies to
          $$(ac-1)p=a+c,$$
          and as $pgeq2$ clearly we cannot have $a,cgeq2$. Hence $c=1$ and so
          $$p^2+1=bq=(cp-1)q=(p-1)q.$$
          In particular $p-1mid p^2+1$. As $p-1mid p^2-1$ it follows that $p-1=2$, so $p=3$ and hence $q=5$.






          share|cite|improve this answer























          • How do I finish this solution? Finding all the solution?
            – Matheus Domingos
            Oct 6 '18 at 19:05










          • @MatheusDomingos I completed the solution for you.
            – Servaes
            Oct 6 '18 at 19:05






          • 1




            Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
            – Matheus Domingos
            Oct 6 '18 at 19:11






          • 1




            I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
            – Servaes
            Oct 6 '18 at 19:12












          • Understood, more elegant this way,thanks again
            – Matheus Domingos
            Oct 6 '18 at 19:14



















          5














          $$p^3+p=q^2+q implies p|q^2+q implies p|q mathrm{or} p|(q+1).$$



          Obviously, $pneq q$, so $pnmid q$. Thus, we can set $q=kp-1$. This then reduces to



          $$p^2-k^2p+(k+1)=0,$$



          which has an integer solution iff $k^4-4k-4$ is a square. Can you see why this is not the case for large $k$, and determine the solutions from there?






          share|cite|improve this answer























          • Oh thanks, now I know how to finish it, thanks
            – Matheus Domingos
            Oct 6 '18 at 18:55










          • Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
            – Matheus Domingos
            Oct 6 '18 at 19:12










          • @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
            – Carl Schildkraut
            Oct 6 '18 at 19:16






          • 1




            Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
            – Servaes
            Oct 6 '18 at 19:17












          • Sorry, I didn't understood how to finish using it
            – Matheus Domingos
            Oct 6 '18 at 19:24



















          2














          Hint: Since $p$ divides $p^3+p$, also $p$ divides $q(q+1)$, hence $p$ either divides $q$ or $p$ divides $q+1$, because $p$ is prime. Can you finish it?






          share|cite|improve this answer





























            2














            Remember that if $a,b$ are positive integers such that $amid b$ then $aleq b$. I'll be using this frekvently here.



            From $$p(p^2+1)= q(q+1)implies pmid q;;;{rm or};;;pmid q+1$$



            1. case $pmid q$, then $q+1mid p^2+1$. Write $q+1=s$ then we get $$psmid (p^2+1)(s-1) = p^2s-p^2+s-1implies psmid p^2-s+1$$



            Since $p^2+1geq s$ we have 2 subcases:



            1.1 case $p^2+1>s$, then $psleq p^2-s+1$ so $s(p+1)leq p^2+1$, and thus $$sleq {p^2+1over p+1} <pimplies sleq p-1$$



            So $q+1leq p-1 leq q-1$ and thus no solution.



            1.2 case $p^2+1=s$, then $q^2+1 = q+1$ and again no solution.



            2. case $pmid q+1$, then $qmid p^2+1$. Then we get $$pqmid (p^2+1)(q+1) = p^2q+p^2+q+1implies pqmid p^2+q+1$$



            so we have $pqleq p^2+q+1$ so $q leq {p^2+1over p-1} leq p+2$ if $pgeq 3$.
            So if $pgeq 3$ and since $pmid q$ that $qin {p,p+1,p+2}$ which is easy to finish by hand.






            share|cite|improve this answer























            • Thanks, got this solution!
              – Matheus Domingos
              Oct 6 '18 at 19:25











            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%2f2944795%2ffind-the-values-of-p-and-q%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









            3














            Clearly $pneq q$, and because $p$ and $q$ are prime and
            $$p(p^2+1)=p^3+p=q^2+q=q(q+1),$$
            we must have $pmid q+1$ and $qmid p^2+1$. Write
            $$q+1=apqquadtext{ and }qquad p^2+1=bq,$$
            to find that $p^2-abp+b+1=0$. In particular $b+1equiv0pmod{p}$, say $b=cp-1$, but then
            $$p^2+1=(cp-1)q=(cp-1)(ap-1)=acp^2-(a+c)p+1.$$
            Note that $a$, $b$ and $c$ are positive integers, and that $a>1$ as otherwise $p=q+1$ which implies that $(p,q)=(3,2)$ which is not a solution. The equation above simplifies to
            $$(ac-1)p=a+c,$$
            and as $pgeq2$ clearly we cannot have $a,cgeq2$. Hence $c=1$ and so
            $$p^2+1=bq=(cp-1)q=(p-1)q.$$
            In particular $p-1mid p^2+1$. As $p-1mid p^2-1$ it follows that $p-1=2$, so $p=3$ and hence $q=5$.






            share|cite|improve this answer























            • How do I finish this solution? Finding all the solution?
              – Matheus Domingos
              Oct 6 '18 at 19:05










            • @MatheusDomingos I completed the solution for you.
              – Servaes
              Oct 6 '18 at 19:05






            • 1




              Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
              – Matheus Domingos
              Oct 6 '18 at 19:11






            • 1




              I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
              – Servaes
              Oct 6 '18 at 19:12












            • Understood, more elegant this way,thanks again
              – Matheus Domingos
              Oct 6 '18 at 19:14
















            3














            Clearly $pneq q$, and because $p$ and $q$ are prime and
            $$p(p^2+1)=p^3+p=q^2+q=q(q+1),$$
            we must have $pmid q+1$ and $qmid p^2+1$. Write
            $$q+1=apqquadtext{ and }qquad p^2+1=bq,$$
            to find that $p^2-abp+b+1=0$. In particular $b+1equiv0pmod{p}$, say $b=cp-1$, but then
            $$p^2+1=(cp-1)q=(cp-1)(ap-1)=acp^2-(a+c)p+1.$$
            Note that $a$, $b$ and $c$ are positive integers, and that $a>1$ as otherwise $p=q+1$ which implies that $(p,q)=(3,2)$ which is not a solution. The equation above simplifies to
            $$(ac-1)p=a+c,$$
            and as $pgeq2$ clearly we cannot have $a,cgeq2$. Hence $c=1$ and so
            $$p^2+1=bq=(cp-1)q=(p-1)q.$$
            In particular $p-1mid p^2+1$. As $p-1mid p^2-1$ it follows that $p-1=2$, so $p=3$ and hence $q=5$.






            share|cite|improve this answer























            • How do I finish this solution? Finding all the solution?
              – Matheus Domingos
              Oct 6 '18 at 19:05










            • @MatheusDomingos I completed the solution for you.
              – Servaes
              Oct 6 '18 at 19:05






            • 1




              Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
              – Matheus Domingos
              Oct 6 '18 at 19:11






            • 1




              I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
              – Servaes
              Oct 6 '18 at 19:12












            • Understood, more elegant this way,thanks again
              – Matheus Domingos
              Oct 6 '18 at 19:14














            3












            3








            3






            Clearly $pneq q$, and because $p$ and $q$ are prime and
            $$p(p^2+1)=p^3+p=q^2+q=q(q+1),$$
            we must have $pmid q+1$ and $qmid p^2+1$. Write
            $$q+1=apqquadtext{ and }qquad p^2+1=bq,$$
            to find that $p^2-abp+b+1=0$. In particular $b+1equiv0pmod{p}$, say $b=cp-1$, but then
            $$p^2+1=(cp-1)q=(cp-1)(ap-1)=acp^2-(a+c)p+1.$$
            Note that $a$, $b$ and $c$ are positive integers, and that $a>1$ as otherwise $p=q+1$ which implies that $(p,q)=(3,2)$ which is not a solution. The equation above simplifies to
            $$(ac-1)p=a+c,$$
            and as $pgeq2$ clearly we cannot have $a,cgeq2$. Hence $c=1$ and so
            $$p^2+1=bq=(cp-1)q=(p-1)q.$$
            In particular $p-1mid p^2+1$. As $p-1mid p^2-1$ it follows that $p-1=2$, so $p=3$ and hence $q=5$.






            share|cite|improve this answer














            Clearly $pneq q$, and because $p$ and $q$ are prime and
            $$p(p^2+1)=p^3+p=q^2+q=q(q+1),$$
            we must have $pmid q+1$ and $qmid p^2+1$. Write
            $$q+1=apqquadtext{ and }qquad p^2+1=bq,$$
            to find that $p^2-abp+b+1=0$. In particular $b+1equiv0pmod{p}$, say $b=cp-1$, but then
            $$p^2+1=(cp-1)q=(cp-1)(ap-1)=acp^2-(a+c)p+1.$$
            Note that $a$, $b$ and $c$ are positive integers, and that $a>1$ as otherwise $p=q+1$ which implies that $(p,q)=(3,2)$ which is not a solution. The equation above simplifies to
            $$(ac-1)p=a+c,$$
            and as $pgeq2$ clearly we cannot have $a,cgeq2$. Hence $c=1$ and so
            $$p^2+1=bq=(cp-1)q=(p-1)q.$$
            In particular $p-1mid p^2+1$. As $p-1mid p^2-1$ it follows that $p-1=2$, so $p=3$ and hence $q=5$.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Oct 6 '18 at 19:13

























            answered Oct 6 '18 at 18:53









            Servaes

            22.4k33793




            22.4k33793












            • How do I finish this solution? Finding all the solution?
              – Matheus Domingos
              Oct 6 '18 at 19:05










            • @MatheusDomingos I completed the solution for you.
              – Servaes
              Oct 6 '18 at 19:05






            • 1




              Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
              – Matheus Domingos
              Oct 6 '18 at 19:11






            • 1




              I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
              – Servaes
              Oct 6 '18 at 19:12












            • Understood, more elegant this way,thanks again
              – Matheus Domingos
              Oct 6 '18 at 19:14


















            • How do I finish this solution? Finding all the solution?
              – Matheus Domingos
              Oct 6 '18 at 19:05










            • @MatheusDomingos I completed the solution for you.
              – Servaes
              Oct 6 '18 at 19:05






            • 1




              Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
              – Matheus Domingos
              Oct 6 '18 at 19:11






            • 1




              I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
              – Servaes
              Oct 6 '18 at 19:12












            • Understood, more elegant this way,thanks again
              – Matheus Domingos
              Oct 6 '18 at 19:14
















            How do I finish this solution? Finding all the solution?
            – Matheus Domingos
            Oct 6 '18 at 19:05




            How do I finish this solution? Finding all the solution?
            – Matheus Domingos
            Oct 6 '18 at 19:05












            @MatheusDomingos I completed the solution for you.
            – Servaes
            Oct 6 '18 at 19:05




            @MatheusDomingos I completed the solution for you.
            – Servaes
            Oct 6 '18 at 19:05




            1




            1




            Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
            – Matheus Domingos
            Oct 6 '18 at 19:11




            Thank you, now I understood the limitation. I need to have a+c=>ac-1... What implies that (a-1)(c-1)=>2. Thanks
            – Matheus Domingos
            Oct 6 '18 at 19:11




            1




            1




            I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
            – Servaes
            Oct 6 '18 at 19:12






            I rearranged the argument a bit, as in fact $a>1$ follows very easily earlier on, simpifying the final step.
            – Servaes
            Oct 6 '18 at 19:12














            Understood, more elegant this way,thanks again
            – Matheus Domingos
            Oct 6 '18 at 19:14




            Understood, more elegant this way,thanks again
            – Matheus Domingos
            Oct 6 '18 at 19:14











            5














            $$p^3+p=q^2+q implies p|q^2+q implies p|q mathrm{or} p|(q+1).$$



            Obviously, $pneq q$, so $pnmid q$. Thus, we can set $q=kp-1$. This then reduces to



            $$p^2-k^2p+(k+1)=0,$$



            which has an integer solution iff $k^4-4k-4$ is a square. Can you see why this is not the case for large $k$, and determine the solutions from there?






            share|cite|improve this answer























            • Oh thanks, now I know how to finish it, thanks
              – Matheus Domingos
              Oct 6 '18 at 18:55










            • Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
              – Matheus Domingos
              Oct 6 '18 at 19:12










            • @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
              – Carl Schildkraut
              Oct 6 '18 at 19:16






            • 1




              Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
              – Servaes
              Oct 6 '18 at 19:17












            • Sorry, I didn't understood how to finish using it
              – Matheus Domingos
              Oct 6 '18 at 19:24
















            5














            $$p^3+p=q^2+q implies p|q^2+q implies p|q mathrm{or} p|(q+1).$$



            Obviously, $pneq q$, so $pnmid q$. Thus, we can set $q=kp-1$. This then reduces to



            $$p^2-k^2p+(k+1)=0,$$



            which has an integer solution iff $k^4-4k-4$ is a square. Can you see why this is not the case for large $k$, and determine the solutions from there?






            share|cite|improve this answer























            • Oh thanks, now I know how to finish it, thanks
              – Matheus Domingos
              Oct 6 '18 at 18:55










            • Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
              – Matheus Domingos
              Oct 6 '18 at 19:12










            • @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
              – Carl Schildkraut
              Oct 6 '18 at 19:16






            • 1




              Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
              – Servaes
              Oct 6 '18 at 19:17












            • Sorry, I didn't understood how to finish using it
              – Matheus Domingos
              Oct 6 '18 at 19:24














            5












            5








            5






            $$p^3+p=q^2+q implies p|q^2+q implies p|q mathrm{or} p|(q+1).$$



            Obviously, $pneq q$, so $pnmid q$. Thus, we can set $q=kp-1$. This then reduces to



            $$p^2-k^2p+(k+1)=0,$$



            which has an integer solution iff $k^4-4k-4$ is a square. Can you see why this is not the case for large $k$, and determine the solutions from there?






            share|cite|improve this answer














            $$p^3+p=q^2+q implies p|q^2+q implies p|q mathrm{or} p|(q+1).$$



            Obviously, $pneq q$, so $pnmid q$. Thus, we can set $q=kp-1$. This then reduces to



            $$p^2-k^2p+(k+1)=0,$$



            which has an integer solution iff $k^4-4k-4$ is a square. Can you see why this is not the case for large $k$, and determine the solutions from there?







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Oct 6 '18 at 19:01

























            answered Oct 6 '18 at 18:54









            Carl Schildkraut

            11.2k11441




            11.2k11441












            • Oh thanks, now I know how to finish it, thanks
              – Matheus Domingos
              Oct 6 '18 at 18:55










            • Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
              – Matheus Domingos
              Oct 6 '18 at 19:12










            • @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
              – Carl Schildkraut
              Oct 6 '18 at 19:16






            • 1




              Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
              – Servaes
              Oct 6 '18 at 19:17












            • Sorry, I didn't understood how to finish using it
              – Matheus Domingos
              Oct 6 '18 at 19:24


















            • Oh thanks, now I know how to finish it, thanks
              – Matheus Domingos
              Oct 6 '18 at 18:55










            • Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
              – Matheus Domingos
              Oct 6 '18 at 19:12










            • @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
              – Carl Schildkraut
              Oct 6 '18 at 19:16






            • 1




              Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
              – Servaes
              Oct 6 '18 at 19:17












            • Sorry, I didn't understood how to finish using it
              – Matheus Domingos
              Oct 6 '18 at 19:24
















            Oh thanks, now I know how to finish it, thanks
            – Matheus Domingos
            Oct 6 '18 at 18:55




            Oh thanks, now I know how to finish it, thanks
            – Matheus Domingos
            Oct 6 '18 at 18:55












            Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
            – Matheus Domingos
            Oct 6 '18 at 19:12




            Is there a better way to do that? I learned in high school to solve that using k^4-4k-4=a^2 and then I have to study that. Is there a better way to do that?
            – Matheus Domingos
            Oct 6 '18 at 19:12












            @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
            – Carl Schildkraut
            Oct 6 '18 at 19:16




            @MatheusDomingos Note that $k^4-4k-4$ is very close to $(k^2)^2$. Specifically, for most positive $k$, it is between $(k^2-1)^2$ and $k^2$.
            – Carl Schildkraut
            Oct 6 '18 at 19:16




            1




            1




            Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
            – Servaes
            Oct 6 '18 at 19:17






            Note that $k^4=(k^2)^2$ is a square, and that the previous square is $$(k^2-1)^2=k^4-2k^2+1,$$ which is smaller than $k^4-4k-4$ whenever $2k^2-1>4k+4$, and so the latter cannot be a square unless $2k^2-1leq 4k+4$.
            – Servaes
            Oct 6 '18 at 19:17














            Sorry, I didn't understood how to finish using it
            – Matheus Domingos
            Oct 6 '18 at 19:24




            Sorry, I didn't understood how to finish using it
            – Matheus Domingos
            Oct 6 '18 at 19:24











            2














            Hint: Since $p$ divides $p^3+p$, also $p$ divides $q(q+1)$, hence $p$ either divides $q$ or $p$ divides $q+1$, because $p$ is prime. Can you finish it?






            share|cite|improve this answer


























              2














              Hint: Since $p$ divides $p^3+p$, also $p$ divides $q(q+1)$, hence $p$ either divides $q$ or $p$ divides $q+1$, because $p$ is prime. Can you finish it?






              share|cite|improve this answer
























                2












                2








                2






                Hint: Since $p$ divides $p^3+p$, also $p$ divides $q(q+1)$, hence $p$ either divides $q$ or $p$ divides $q+1$, because $p$ is prime. Can you finish it?






                share|cite|improve this answer












                Hint: Since $p$ divides $p^3+p$, also $p$ divides $q(q+1)$, hence $p$ either divides $q$ or $p$ divides $q+1$, because $p$ is prime. Can you finish it?







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Oct 6 '18 at 18:52









                Dietrich Burde

                77.7k64386




                77.7k64386























                    2














                    Remember that if $a,b$ are positive integers such that $amid b$ then $aleq b$. I'll be using this frekvently here.



                    From $$p(p^2+1)= q(q+1)implies pmid q;;;{rm or};;;pmid q+1$$



                    1. case $pmid q$, then $q+1mid p^2+1$. Write $q+1=s$ then we get $$psmid (p^2+1)(s-1) = p^2s-p^2+s-1implies psmid p^2-s+1$$



                    Since $p^2+1geq s$ we have 2 subcases:



                    1.1 case $p^2+1>s$, then $psleq p^2-s+1$ so $s(p+1)leq p^2+1$, and thus $$sleq {p^2+1over p+1} <pimplies sleq p-1$$



                    So $q+1leq p-1 leq q-1$ and thus no solution.



                    1.2 case $p^2+1=s$, then $q^2+1 = q+1$ and again no solution.



                    2. case $pmid q+1$, then $qmid p^2+1$. Then we get $$pqmid (p^2+1)(q+1) = p^2q+p^2+q+1implies pqmid p^2+q+1$$



                    so we have $pqleq p^2+q+1$ so $q leq {p^2+1over p-1} leq p+2$ if $pgeq 3$.
                    So if $pgeq 3$ and since $pmid q$ that $qin {p,p+1,p+2}$ which is easy to finish by hand.






                    share|cite|improve this answer























                    • Thanks, got this solution!
                      – Matheus Domingos
                      Oct 6 '18 at 19:25
















                    2














                    Remember that if $a,b$ are positive integers such that $amid b$ then $aleq b$. I'll be using this frekvently here.



                    From $$p(p^2+1)= q(q+1)implies pmid q;;;{rm or};;;pmid q+1$$



                    1. case $pmid q$, then $q+1mid p^2+1$. Write $q+1=s$ then we get $$psmid (p^2+1)(s-1) = p^2s-p^2+s-1implies psmid p^2-s+1$$



                    Since $p^2+1geq s$ we have 2 subcases:



                    1.1 case $p^2+1>s$, then $psleq p^2-s+1$ so $s(p+1)leq p^2+1$, and thus $$sleq {p^2+1over p+1} <pimplies sleq p-1$$



                    So $q+1leq p-1 leq q-1$ and thus no solution.



                    1.2 case $p^2+1=s$, then $q^2+1 = q+1$ and again no solution.



                    2. case $pmid q+1$, then $qmid p^2+1$. Then we get $$pqmid (p^2+1)(q+1) = p^2q+p^2+q+1implies pqmid p^2+q+1$$



                    so we have $pqleq p^2+q+1$ so $q leq {p^2+1over p-1} leq p+2$ if $pgeq 3$.
                    So if $pgeq 3$ and since $pmid q$ that $qin {p,p+1,p+2}$ which is easy to finish by hand.






                    share|cite|improve this answer























                    • Thanks, got this solution!
                      – Matheus Domingos
                      Oct 6 '18 at 19:25














                    2












                    2








                    2






                    Remember that if $a,b$ are positive integers such that $amid b$ then $aleq b$. I'll be using this frekvently here.



                    From $$p(p^2+1)= q(q+1)implies pmid q;;;{rm or};;;pmid q+1$$



                    1. case $pmid q$, then $q+1mid p^2+1$. Write $q+1=s$ then we get $$psmid (p^2+1)(s-1) = p^2s-p^2+s-1implies psmid p^2-s+1$$



                    Since $p^2+1geq s$ we have 2 subcases:



                    1.1 case $p^2+1>s$, then $psleq p^2-s+1$ so $s(p+1)leq p^2+1$, and thus $$sleq {p^2+1over p+1} <pimplies sleq p-1$$



                    So $q+1leq p-1 leq q-1$ and thus no solution.



                    1.2 case $p^2+1=s$, then $q^2+1 = q+1$ and again no solution.



                    2. case $pmid q+1$, then $qmid p^2+1$. Then we get $$pqmid (p^2+1)(q+1) = p^2q+p^2+q+1implies pqmid p^2+q+1$$



                    so we have $pqleq p^2+q+1$ so $q leq {p^2+1over p-1} leq p+2$ if $pgeq 3$.
                    So if $pgeq 3$ and since $pmid q$ that $qin {p,p+1,p+2}$ which is easy to finish by hand.






                    share|cite|improve this answer














                    Remember that if $a,b$ are positive integers such that $amid b$ then $aleq b$. I'll be using this frekvently here.



                    From $$p(p^2+1)= q(q+1)implies pmid q;;;{rm or};;;pmid q+1$$



                    1. case $pmid q$, then $q+1mid p^2+1$. Write $q+1=s$ then we get $$psmid (p^2+1)(s-1) = p^2s-p^2+s-1implies psmid p^2-s+1$$



                    Since $p^2+1geq s$ we have 2 subcases:



                    1.1 case $p^2+1>s$, then $psleq p^2-s+1$ so $s(p+1)leq p^2+1$, and thus $$sleq {p^2+1over p+1} <pimplies sleq p-1$$



                    So $q+1leq p-1 leq q-1$ and thus no solution.



                    1.2 case $p^2+1=s$, then $q^2+1 = q+1$ and again no solution.



                    2. case $pmid q+1$, then $qmid p^2+1$. Then we get $$pqmid (p^2+1)(q+1) = p^2q+p^2+q+1implies pqmid p^2+q+1$$



                    so we have $pqleq p^2+q+1$ so $q leq {p^2+1over p-1} leq p+2$ if $pgeq 3$.
                    So if $pgeq 3$ and since $pmid q$ that $qin {p,p+1,p+2}$ which is easy to finish by hand.







                    share|cite|improve this answer














                    share|cite|improve this answer



                    share|cite|improve this answer








                    edited Oct 6 '18 at 19:11

























                    answered Oct 6 '18 at 18:54









                    greedoid

                    38k114794




                    38k114794












                    • Thanks, got this solution!
                      – Matheus Domingos
                      Oct 6 '18 at 19:25


















                    • Thanks, got this solution!
                      – Matheus Domingos
                      Oct 6 '18 at 19:25
















                    Thanks, got this solution!
                    – Matheus Domingos
                    Oct 6 '18 at 19:25




                    Thanks, got this solution!
                    – Matheus Domingos
                    Oct 6 '18 at 19:25


















                    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%2f2944795%2ffind-the-values-of-p-and-q%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

                    Probability when a professor distributes a quiz and homework assignment to a class of n students.

                    Aardman Animations

                    Are they similar matrix