Possibilty of a number $n$ to be a multiple of $x$ that has a remainder of $y$

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Is there a formula or solution for this :
"$n$ is a number that is a multiple of $x$ and when divided by $b$ has remainder of $y$".



Is there a fast way to finding this number?







share|cite|improve this question






















  • So you are asking for a solution to $axequiv ymodb$? Why would you assume there is only one solution?
    – Rushabh Mehta
    Aug 18 at 2:33










  • Have you tried plugging in specific numbers and seeing what happens? Let's say $n = 40$ which is a multiple of $x = 10$ and has a remainder of $y = 3$ when divided by... what?
    – Robert Soupe
    Aug 19 at 16:11










  • Yes and its been tricky lets say you have all what you need except for the $n$.
    – MMJM
    Aug 20 at 9:39











  • @Rushabh I'm not asking for a one specific solution. What I want is a fast method for finding n.
    – MMJM
    Aug 20 at 9:41















up vote
1
down vote

favorite












Is there a formula or solution for this :
"$n$ is a number that is a multiple of $x$ and when divided by $b$ has remainder of $y$".



Is there a fast way to finding this number?







share|cite|improve this question






















  • So you are asking for a solution to $axequiv ymodb$? Why would you assume there is only one solution?
    – Rushabh Mehta
    Aug 18 at 2:33










  • Have you tried plugging in specific numbers and seeing what happens? Let's say $n = 40$ which is a multiple of $x = 10$ and has a remainder of $y = 3$ when divided by... what?
    – Robert Soupe
    Aug 19 at 16:11










  • Yes and its been tricky lets say you have all what you need except for the $n$.
    – MMJM
    Aug 20 at 9:39











  • @Rushabh I'm not asking for a one specific solution. What I want is a fast method for finding n.
    – MMJM
    Aug 20 at 9:41













up vote
1
down vote

favorite









up vote
1
down vote

favorite











Is there a formula or solution for this :
"$n$ is a number that is a multiple of $x$ and when divided by $b$ has remainder of $y$".



Is there a fast way to finding this number?







share|cite|improve this question














Is there a formula or solution for this :
"$n$ is a number that is a multiple of $x$ and when divided by $b$ has remainder of $y$".



Is there a fast way to finding this number?









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 19 at 16:08









Robert Soupe

10.1k21947




10.1k21947










asked Aug 18 at 2:13









MMJM

205




205











  • So you are asking for a solution to $axequiv ymodb$? Why would you assume there is only one solution?
    – Rushabh Mehta
    Aug 18 at 2:33










  • Have you tried plugging in specific numbers and seeing what happens? Let's say $n = 40$ which is a multiple of $x = 10$ and has a remainder of $y = 3$ when divided by... what?
    – Robert Soupe
    Aug 19 at 16:11










  • Yes and its been tricky lets say you have all what you need except for the $n$.
    – MMJM
    Aug 20 at 9:39











  • @Rushabh I'm not asking for a one specific solution. What I want is a fast method for finding n.
    – MMJM
    Aug 20 at 9:41

















  • So you are asking for a solution to $axequiv ymodb$? Why would you assume there is only one solution?
    – Rushabh Mehta
    Aug 18 at 2:33










  • Have you tried plugging in specific numbers and seeing what happens? Let's say $n = 40$ which is a multiple of $x = 10$ and has a remainder of $y = 3$ when divided by... what?
    – Robert Soupe
    Aug 19 at 16:11










  • Yes and its been tricky lets say you have all what you need except for the $n$.
    – MMJM
    Aug 20 at 9:39











  • @Rushabh I'm not asking for a one specific solution. What I want is a fast method for finding n.
    – MMJM
    Aug 20 at 9:41
















So you are asking for a solution to $axequiv ymodb$? Why would you assume there is only one solution?
– Rushabh Mehta
Aug 18 at 2:33




So you are asking for a solution to $axequiv ymodb$? Why would you assume there is only one solution?
– Rushabh Mehta
Aug 18 at 2:33












Have you tried plugging in specific numbers and seeing what happens? Let's say $n = 40$ which is a multiple of $x = 10$ and has a remainder of $y = 3$ when divided by... what?
– Robert Soupe
Aug 19 at 16:11




Have you tried plugging in specific numbers and seeing what happens? Let's say $n = 40$ which is a multiple of $x = 10$ and has a remainder of $y = 3$ when divided by... what?
– Robert Soupe
Aug 19 at 16:11












Yes and its been tricky lets say you have all what you need except for the $n$.
– MMJM
Aug 20 at 9:39





Yes and its been tricky lets say you have all what you need except for the $n$.
– MMJM
Aug 20 at 9:39













@Rushabh I'm not asking for a one specific solution. What I want is a fast method for finding n.
– MMJM
Aug 20 at 9:41





@Rushabh I'm not asking for a one specific solution. What I want is a fast method for finding n.
– MMJM
Aug 20 at 9:41











1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










The short answer is "No". Here is the long answer.



$n equiv 0 pmod x implies n = alpha x textfor some integer $alpha$$



$n equiv y pmod b implies alpha x equiv y pmod b$



Let $g = gcd(x, b)$. Then there is no solution unless $g mid y$.



If $g mid y$...



Let $X = dfrac xg, quad Y = dfrac yg, quad B = dfrac bg.$



Then $alpha X equiv Y pmod B$ and $gcd(X,B) = 1$.



So there exists integers $xi, beta$ such that $xi X + beta B = 1$.



Then $xi Y equiv alpha xi X equiv alpha - alpha beta B equiv alpha pmod B$.



That is $alpha equiv xi Y pmod B$



Example.



Find a number $n$ that is a multiple of $20$ and leaves a remainder of $24$ when divided by $34$.



We have $x = 20, quad y=24, quad b=34$.



$n equiv 0 pmod20 implies n = 20 alpha textfor some integer $alpha$$.



$n equiv 24 pmod34 implies 20 alpha equiv 24 pmod34$



Let $g = gcd(20, 34) = 2$. Then there is no solution unless $2 mid 24$. Which it does.



Let $X = dfrac202 = 10, quad Y = dfrac242=12, quad B = dfrac342=17.$



Then $10 alpha equiv 12 pmod17$ and $gcd(10,17) = 1$.



So there exists integers $xi, beta$ such that $10 xi + 17 beta = 1$.



beginarrayr
& 17 & 1 & 0 & 17 = (1)17 + (0)10\
-1 & 10 & 0 & 1 & 10 = (0)17 + (1)10\
hline
-1 & 7 & 1 & -1 & 7 = (1)17 + (-1)10\
-2 & 3 & -1 & 2 & 3 = (-1)17 + (2)10 \
hline
& 1 & 3 & -5 & 1 = (3)17 + (-5)10
endarray



We find $xi = 3, quad beta = -5$



So $alpha equiv -5 cdot 12 = -60 pmod17 = 8 pmod17$



and $n = 20alpha = 160$



CHECK:



$160$ is a multiple of $20$



$160 = 4 cdot 34 + 24$






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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f2886348%2fpossibilty-of-a-number-n-to-be-a-multiple-of-x-that-has-a-remainder-of-y%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    The short answer is "No". Here is the long answer.



    $n equiv 0 pmod x implies n = alpha x textfor some integer $alpha$$



    $n equiv y pmod b implies alpha x equiv y pmod b$



    Let $g = gcd(x, b)$. Then there is no solution unless $g mid y$.



    If $g mid y$...



    Let $X = dfrac xg, quad Y = dfrac yg, quad B = dfrac bg.$



    Then $alpha X equiv Y pmod B$ and $gcd(X,B) = 1$.



    So there exists integers $xi, beta$ such that $xi X + beta B = 1$.



    Then $xi Y equiv alpha xi X equiv alpha - alpha beta B equiv alpha pmod B$.



    That is $alpha equiv xi Y pmod B$



    Example.



    Find a number $n$ that is a multiple of $20$ and leaves a remainder of $24$ when divided by $34$.



    We have $x = 20, quad y=24, quad b=34$.



    $n equiv 0 pmod20 implies n = 20 alpha textfor some integer $alpha$$.



    $n equiv 24 pmod34 implies 20 alpha equiv 24 pmod34$



    Let $g = gcd(20, 34) = 2$. Then there is no solution unless $2 mid 24$. Which it does.



    Let $X = dfrac202 = 10, quad Y = dfrac242=12, quad B = dfrac342=17.$



    Then $10 alpha equiv 12 pmod17$ and $gcd(10,17) = 1$.



    So there exists integers $xi, beta$ such that $10 xi + 17 beta = 1$.



    beginarrayr
    & 17 & 1 & 0 & 17 = (1)17 + (0)10\
    -1 & 10 & 0 & 1 & 10 = (0)17 + (1)10\
    hline
    -1 & 7 & 1 & -1 & 7 = (1)17 + (-1)10\
    -2 & 3 & -1 & 2 & 3 = (-1)17 + (2)10 \
    hline
    & 1 & 3 & -5 & 1 = (3)17 + (-5)10
    endarray



    We find $xi = 3, quad beta = -5$



    So $alpha equiv -5 cdot 12 = -60 pmod17 = 8 pmod17$



    and $n = 20alpha = 160$



    CHECK:



    $160$ is a multiple of $20$



    $160 = 4 cdot 34 + 24$






    share|cite|improve this answer
























      up vote
      1
      down vote



      accepted










      The short answer is "No". Here is the long answer.



      $n equiv 0 pmod x implies n = alpha x textfor some integer $alpha$$



      $n equiv y pmod b implies alpha x equiv y pmod b$



      Let $g = gcd(x, b)$. Then there is no solution unless $g mid y$.



      If $g mid y$...



      Let $X = dfrac xg, quad Y = dfrac yg, quad B = dfrac bg.$



      Then $alpha X equiv Y pmod B$ and $gcd(X,B) = 1$.



      So there exists integers $xi, beta$ such that $xi X + beta B = 1$.



      Then $xi Y equiv alpha xi X equiv alpha - alpha beta B equiv alpha pmod B$.



      That is $alpha equiv xi Y pmod B$



      Example.



      Find a number $n$ that is a multiple of $20$ and leaves a remainder of $24$ when divided by $34$.



      We have $x = 20, quad y=24, quad b=34$.



      $n equiv 0 pmod20 implies n = 20 alpha textfor some integer $alpha$$.



      $n equiv 24 pmod34 implies 20 alpha equiv 24 pmod34$



      Let $g = gcd(20, 34) = 2$. Then there is no solution unless $2 mid 24$. Which it does.



      Let $X = dfrac202 = 10, quad Y = dfrac242=12, quad B = dfrac342=17.$



      Then $10 alpha equiv 12 pmod17$ and $gcd(10,17) = 1$.



      So there exists integers $xi, beta$ such that $10 xi + 17 beta = 1$.



      beginarrayr
      & 17 & 1 & 0 & 17 = (1)17 + (0)10\
      -1 & 10 & 0 & 1 & 10 = (0)17 + (1)10\
      hline
      -1 & 7 & 1 & -1 & 7 = (1)17 + (-1)10\
      -2 & 3 & -1 & 2 & 3 = (-1)17 + (2)10 \
      hline
      & 1 & 3 & -5 & 1 = (3)17 + (-5)10
      endarray



      We find $xi = 3, quad beta = -5$



      So $alpha equiv -5 cdot 12 = -60 pmod17 = 8 pmod17$



      and $n = 20alpha = 160$



      CHECK:



      $160$ is a multiple of $20$



      $160 = 4 cdot 34 + 24$






      share|cite|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        The short answer is "No". Here is the long answer.



        $n equiv 0 pmod x implies n = alpha x textfor some integer $alpha$$



        $n equiv y pmod b implies alpha x equiv y pmod b$



        Let $g = gcd(x, b)$. Then there is no solution unless $g mid y$.



        If $g mid y$...



        Let $X = dfrac xg, quad Y = dfrac yg, quad B = dfrac bg.$



        Then $alpha X equiv Y pmod B$ and $gcd(X,B) = 1$.



        So there exists integers $xi, beta$ such that $xi X + beta B = 1$.



        Then $xi Y equiv alpha xi X equiv alpha - alpha beta B equiv alpha pmod B$.



        That is $alpha equiv xi Y pmod B$



        Example.



        Find a number $n$ that is a multiple of $20$ and leaves a remainder of $24$ when divided by $34$.



        We have $x = 20, quad y=24, quad b=34$.



        $n equiv 0 pmod20 implies n = 20 alpha textfor some integer $alpha$$.



        $n equiv 24 pmod34 implies 20 alpha equiv 24 pmod34$



        Let $g = gcd(20, 34) = 2$. Then there is no solution unless $2 mid 24$. Which it does.



        Let $X = dfrac202 = 10, quad Y = dfrac242=12, quad B = dfrac342=17.$



        Then $10 alpha equiv 12 pmod17$ and $gcd(10,17) = 1$.



        So there exists integers $xi, beta$ such that $10 xi + 17 beta = 1$.



        beginarrayr
        & 17 & 1 & 0 & 17 = (1)17 + (0)10\
        -1 & 10 & 0 & 1 & 10 = (0)17 + (1)10\
        hline
        -1 & 7 & 1 & -1 & 7 = (1)17 + (-1)10\
        -2 & 3 & -1 & 2 & 3 = (-1)17 + (2)10 \
        hline
        & 1 & 3 & -5 & 1 = (3)17 + (-5)10
        endarray



        We find $xi = 3, quad beta = -5$



        So $alpha equiv -5 cdot 12 = -60 pmod17 = 8 pmod17$



        and $n = 20alpha = 160$



        CHECK:



        $160$ is a multiple of $20$



        $160 = 4 cdot 34 + 24$






        share|cite|improve this answer












        The short answer is "No". Here is the long answer.



        $n equiv 0 pmod x implies n = alpha x textfor some integer $alpha$$



        $n equiv y pmod b implies alpha x equiv y pmod b$



        Let $g = gcd(x, b)$. Then there is no solution unless $g mid y$.



        If $g mid y$...



        Let $X = dfrac xg, quad Y = dfrac yg, quad B = dfrac bg.$



        Then $alpha X equiv Y pmod B$ and $gcd(X,B) = 1$.



        So there exists integers $xi, beta$ such that $xi X + beta B = 1$.



        Then $xi Y equiv alpha xi X equiv alpha - alpha beta B equiv alpha pmod B$.



        That is $alpha equiv xi Y pmod B$



        Example.



        Find a number $n$ that is a multiple of $20$ and leaves a remainder of $24$ when divided by $34$.



        We have $x = 20, quad y=24, quad b=34$.



        $n equiv 0 pmod20 implies n = 20 alpha textfor some integer $alpha$$.



        $n equiv 24 pmod34 implies 20 alpha equiv 24 pmod34$



        Let $g = gcd(20, 34) = 2$. Then there is no solution unless $2 mid 24$. Which it does.



        Let $X = dfrac202 = 10, quad Y = dfrac242=12, quad B = dfrac342=17.$



        Then $10 alpha equiv 12 pmod17$ and $gcd(10,17) = 1$.



        So there exists integers $xi, beta$ such that $10 xi + 17 beta = 1$.



        beginarrayr
        & 17 & 1 & 0 & 17 = (1)17 + (0)10\
        -1 & 10 & 0 & 1 & 10 = (0)17 + (1)10\
        hline
        -1 & 7 & 1 & -1 & 7 = (1)17 + (-1)10\
        -2 & 3 & -1 & 2 & 3 = (-1)17 + (2)10 \
        hline
        & 1 & 3 & -5 & 1 = (3)17 + (-5)10
        endarray



        We find $xi = 3, quad beta = -5$



        So $alpha equiv -5 cdot 12 = -60 pmod17 = 8 pmod17$



        and $n = 20alpha = 160$



        CHECK:



        $160$ is a multiple of $20$



        $160 = 4 cdot 34 + 24$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Aug 20 at 15:10









        steven gregory

        16.6k22055




        16.6k22055






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2886348%2fpossibilty-of-a-number-n-to-be-a-multiple-of-x-that-has-a-remainder-of-y%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            How to combine Bézier curves to a surface?

            Mutual Information Always Non-negative

            Why am i infinitely getting the same tweet with the Twitter Search API?