Can 2018 be written as a sum of two squares? If can, what is the expression?












0















Can $2018$ be written as a sum of two squares?



If it can be, what are the numbers?




I know the first answer is it can be because $2018=2times1009$ and $1009equiv 1 pmod{4}$. But I cannot find the numbers.










share|cite|improve this question




















  • 1




    If all you care about is the numbers, then wolframalpha can help.
    – JMoravitz
    Dec 7 '17 at 4:18










  • By hit and trial, you can verify that $2018 = 13^2 + cdots$
    – Math Lover
    Dec 7 '17 at 4:21










  • For a small number like this, just make a column in a spreadsheet with $1$ to $45$ then =sqrt(2018-left^2) will make it easy to find. Just search by eye for the entries without decimals. They leap out.
    – Ross Millikan
    Dec 7 '17 at 4:21












  • See math.stackexchange.com/questions/1828694/…
    – lab bhattacharjee
    Dec 7 '17 at 4:41
















0















Can $2018$ be written as a sum of two squares?



If it can be, what are the numbers?




I know the first answer is it can be because $2018=2times1009$ and $1009equiv 1 pmod{4}$. But I cannot find the numbers.










share|cite|improve this question




















  • 1




    If all you care about is the numbers, then wolframalpha can help.
    – JMoravitz
    Dec 7 '17 at 4:18










  • By hit and trial, you can verify that $2018 = 13^2 + cdots$
    – Math Lover
    Dec 7 '17 at 4:21










  • For a small number like this, just make a column in a spreadsheet with $1$ to $45$ then =sqrt(2018-left^2) will make it easy to find. Just search by eye for the entries without decimals. They leap out.
    – Ross Millikan
    Dec 7 '17 at 4:21












  • See math.stackexchange.com/questions/1828694/…
    – lab bhattacharjee
    Dec 7 '17 at 4:41














0












0








0


2






Can $2018$ be written as a sum of two squares?



If it can be, what are the numbers?




I know the first answer is it can be because $2018=2times1009$ and $1009equiv 1 pmod{4}$. But I cannot find the numbers.










share|cite|improve this question
















Can $2018$ be written as a sum of two squares?



If it can be, what are the numbers?




I know the first answer is it can be because $2018=2times1009$ and $1009equiv 1 pmod{4}$. But I cannot find the numbers.







elementary-number-theory






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 16 '17 at 17:39









amWhy

191k28224439




191k28224439










asked Dec 7 '17 at 4:15









Joe sae

65




65








  • 1




    If all you care about is the numbers, then wolframalpha can help.
    – JMoravitz
    Dec 7 '17 at 4:18










  • By hit and trial, you can verify that $2018 = 13^2 + cdots$
    – Math Lover
    Dec 7 '17 at 4:21










  • For a small number like this, just make a column in a spreadsheet with $1$ to $45$ then =sqrt(2018-left^2) will make it easy to find. Just search by eye for the entries without decimals. They leap out.
    – Ross Millikan
    Dec 7 '17 at 4:21












  • See math.stackexchange.com/questions/1828694/…
    – lab bhattacharjee
    Dec 7 '17 at 4:41














  • 1




    If all you care about is the numbers, then wolframalpha can help.
    – JMoravitz
    Dec 7 '17 at 4:18










  • By hit and trial, you can verify that $2018 = 13^2 + cdots$
    – Math Lover
    Dec 7 '17 at 4:21










  • For a small number like this, just make a column in a spreadsheet with $1$ to $45$ then =sqrt(2018-left^2) will make it easy to find. Just search by eye for the entries without decimals. They leap out.
    – Ross Millikan
    Dec 7 '17 at 4:21












  • See math.stackexchange.com/questions/1828694/…
    – lab bhattacharjee
    Dec 7 '17 at 4:41








1




1




If all you care about is the numbers, then wolframalpha can help.
– JMoravitz
Dec 7 '17 at 4:18




If all you care about is the numbers, then wolframalpha can help.
– JMoravitz
Dec 7 '17 at 4:18












By hit and trial, you can verify that $2018 = 13^2 + cdots$
– Math Lover
Dec 7 '17 at 4:21




By hit and trial, you can verify that $2018 = 13^2 + cdots$
– Math Lover
Dec 7 '17 at 4:21












For a small number like this, just make a column in a spreadsheet with $1$ to $45$ then =sqrt(2018-left^2) will make it easy to find. Just search by eye for the entries without decimals. They leap out.
– Ross Millikan
Dec 7 '17 at 4:21






For a small number like this, just make a column in a spreadsheet with $1$ to $45$ then =sqrt(2018-left^2) will make it easy to find. Just search by eye for the entries without decimals. They leap out.
– Ross Millikan
Dec 7 '17 at 4:21














See math.stackexchange.com/questions/1828694/…
– lab bhattacharjee
Dec 7 '17 at 4:41




See math.stackexchange.com/questions/1828694/…
– lab bhattacharjee
Dec 7 '17 at 4:41










1 Answer
1






active

oldest

votes


















5














Yes, $2018 = 2times 1009$ (as prime factorization). Since $1009$ is an odd prime of the form $4k+1$, it can be written as a sum of two squares $1009 = a^2+b^2$. Together with $2 = 1^2 + 1^2$,
Brahmagupta–Fibonacci identity
$$(a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 = (ac+bd)^2 + (ad-bc)^2$$
tell us $2018 = (a+b)^2 + (a-b)^2$.



The task reduces to rewrite $1009$ as a sum of two squares. In addition to
seaching by brute force, one can use algorithms described in
answers of this question to determine $a,b$ efficiently. At the end, one find $$1009 = 28^2+15^2 quadimpliesquad 2018 = 43^2 + 13^2$$



A good reference of these sort of algorithms will be Henri Cohen's book
A course in Computation Algebraic Number Theory. Take a look at that if you need more details.






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',
    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%2f2555005%2fcan-2018-be-written-as-a-sum-of-two-squares-if-can-what-is-the-expression%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    Yes, $2018 = 2times 1009$ (as prime factorization). Since $1009$ is an odd prime of the form $4k+1$, it can be written as a sum of two squares $1009 = a^2+b^2$. Together with $2 = 1^2 + 1^2$,
    Brahmagupta–Fibonacci identity
    $$(a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 = (ac+bd)^2 + (ad-bc)^2$$
    tell us $2018 = (a+b)^2 + (a-b)^2$.



    The task reduces to rewrite $1009$ as a sum of two squares. In addition to
    seaching by brute force, one can use algorithms described in
    answers of this question to determine $a,b$ efficiently. At the end, one find $$1009 = 28^2+15^2 quadimpliesquad 2018 = 43^2 + 13^2$$



    A good reference of these sort of algorithms will be Henri Cohen's book
    A course in Computation Algebraic Number Theory. Take a look at that if you need more details.






    share|cite|improve this answer




























      5














      Yes, $2018 = 2times 1009$ (as prime factorization). Since $1009$ is an odd prime of the form $4k+1$, it can be written as a sum of two squares $1009 = a^2+b^2$. Together with $2 = 1^2 + 1^2$,
      Brahmagupta–Fibonacci identity
      $$(a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 = (ac+bd)^2 + (ad-bc)^2$$
      tell us $2018 = (a+b)^2 + (a-b)^2$.



      The task reduces to rewrite $1009$ as a sum of two squares. In addition to
      seaching by brute force, one can use algorithms described in
      answers of this question to determine $a,b$ efficiently. At the end, one find $$1009 = 28^2+15^2 quadimpliesquad 2018 = 43^2 + 13^2$$



      A good reference of these sort of algorithms will be Henri Cohen's book
      A course in Computation Algebraic Number Theory. Take a look at that if you need more details.






      share|cite|improve this answer


























        5












        5








        5






        Yes, $2018 = 2times 1009$ (as prime factorization). Since $1009$ is an odd prime of the form $4k+1$, it can be written as a sum of two squares $1009 = a^2+b^2$. Together with $2 = 1^2 + 1^2$,
        Brahmagupta–Fibonacci identity
        $$(a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 = (ac+bd)^2 + (ad-bc)^2$$
        tell us $2018 = (a+b)^2 + (a-b)^2$.



        The task reduces to rewrite $1009$ as a sum of two squares. In addition to
        seaching by brute force, one can use algorithms described in
        answers of this question to determine $a,b$ efficiently. At the end, one find $$1009 = 28^2+15^2 quadimpliesquad 2018 = 43^2 + 13^2$$



        A good reference of these sort of algorithms will be Henri Cohen's book
        A course in Computation Algebraic Number Theory. Take a look at that if you need more details.






        share|cite|improve this answer














        Yes, $2018 = 2times 1009$ (as prime factorization). Since $1009$ is an odd prime of the form $4k+1$, it can be written as a sum of two squares $1009 = a^2+b^2$. Together with $2 = 1^2 + 1^2$,
        Brahmagupta–Fibonacci identity
        $$(a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 = (ac+bd)^2 + (ad-bc)^2$$
        tell us $2018 = (a+b)^2 + (a-b)^2$.



        The task reduces to rewrite $1009$ as a sum of two squares. In addition to
        seaching by brute force, one can use algorithms described in
        answers of this question to determine $a,b$ efficiently. At the end, one find $$1009 = 28^2+15^2 quadimpliesquad 2018 = 43^2 + 13^2$$



        A good reference of these sort of algorithms will be Henri Cohen's book
        A course in Computation Algebraic Number Theory. Take a look at that if you need more details.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Nov 25 at 19:49









        LoPablo

        33




        33










        answered Dec 7 '17 at 4:51









        achille hui

        95.2k5129256




        95.2k5129256






























            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%2f2555005%2fcan-2018-be-written-as-a-sum-of-two-squares-if-can-what-is-the-expression%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

            Le Mesnil-Réaume

            Ida-Boy-Ed-Garten

            web3.py web3.isConnected() returns false always