Given a positive integers x,y,m would like to be able to find integer solutions z from Diophantine equation x^2-y^2 = m*z in Z.
$\begingroup$
$\endgroup$
4
-
3$\begingroup$ Do you mean you want a purely mathematical solution rather than one using Mathematica? If that's the case try the Mathematics StackExchange where such problems are in scope. $\endgroup$– b3m2a1Commented Nov 3, 2018 at 15:30
-
$\begingroup$ Τo use the program is easy but does not solve the problem at its root. I could do it too. I will give it after a few hours just to be there.. $\endgroup$– Nikos MantzakourasCommented Nov 3, 2018 at 15:33
-
3$\begingroup$ That sounds like this question should really be here. This site is solely intended for questions pertaining to Mathematica the software developed by Wolfram Research. Pure math questions are intended to be on math.stackexchange. $\endgroup$– b3m2a1Commented Nov 3, 2018 at 15:35
-
$\begingroup$ For reference, it would be quite useful to have a full example comprised of representative input (in Mathematica format so it can be cut-and-pasted), and the desired result. $\endgroup$– Daniel LichtblauCommented Nov 4, 2018 at 22:27
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
12
You could try
FindInstance[{X^2 - Y^2 == M Z }, {X, Y, Z, M}, Integers, 3]
(*{{X -> 0, Y -> 301, Z -> -1, M -> 90601}, {X -> -139, Y -> -139,Z -> 1, M -> 0}, {X -> 8, Y -> 8, Z -> -37, M -> 0}}*)
The general solution can be calculated as follows:
Reduce[{x^2 - y^2 == m*z, Element[{x, y, m}, Integers] }, z, Integers]
(*(m | x | y | z) \[Element]Integers && ((m <= -1 && z == (x^2 - y^2)/m) || (m ==0 && (y == -Abs[x] || y == Abs[x])) || (m >= 1 &&z == (x^2 - y^2)/m))*)
-
4$\begingroup$ @Nikos Mantzakouras Sorry, I rolled-back your edit because I falsely approved your edit. Now I am not convinced any more that your edit contained what the author intended. If you want to provide additional information, please edit your question. If you have found your own answer or an extension of this one, you may consider posting it as a separate answer. $\endgroup$ Commented Nov 3, 2018 at 13:41
-
$\begingroup$ sorry i dont want a approach solution i write in begin and i delete this because you delete my work $\endgroup$ Commented Nov 3, 2018 at 14:09
-
2$\begingroup$ @NikosMantzakouras please take some time to read what SE is about: mathematica.stackexchange.com/help That way you won't be surprised that your edit to someone else's answer is not obligated to be approved. $\endgroup$– KubaCommented Nov 3, 2018 at 15:41
-
$\begingroup$ To write the work in mathematica more down (below) on mine .No on my work .I do not erase yours ..Better behavior more humane $\endgroup$ Commented Nov 3, 2018 at 15:44
-
2$\begingroup$ @NikosMantzakouras To attempt to replace someone's answer by your own is considered to be very bad manners here. If you wish, submit your own answer using the box below. $\endgroup$ Commented Nov 3, 2018 at 16:28