"A little pie costs 23, and a cake costs 49. Is it possible to reach 500$ selling both of the products?"
My attempt:
$\\23x + 49y = 500 \\23x + 49y \equiv 500 \pmod{23} \\0x + 3y \equiv 17 \pmod{23} \\3y \equiv 17 \pmod{23} \\y \equiv 21 \pmod{23}\\23x+49(21+23k)=500 \\ \text{then:}\\\\x=-23-49k \\y=21+23k$
I have already tested some values and it seems to work well, the thing is:
Is there a way to know if I can reach 500 by only using positive integers? If yes, then how? I want to do so because I guess he can't sell negative pies or negative cakes, If I am wrong, please let me any hints, thanks in advance.
is normalized, i.e. $0\le X < n,,$ so by $,Y< 0,$ the equation $,500 = 49X+ 23Y,$ has no integer roots $,X,Y\ge 0,,$ by the Lemma in the linked dupe. See the Linked question there for many answers on this FAQ.
– Bill Dubuque Nov 12 '21 at 09:27