Why does Solve lock up when trying to solve the quadratic equation with large integers?Why does repeating an equation help in FindRoot?Why does Mathematica fail to solve my equation?How to solve this equation with integers as a solution?Mathematica Solve function does not solve double exponentialEquation is solved quickly using Solve but takes too long using NSolveSolve gives duplicate solutions for a particular equationSolveAlways keeps on loadingSolve an exponential equation in integersUnexpected behaviour with FindInstanceWhy does NDSolve work with an initial condition but not a final condition?
Identifying the interval from A♭ to D♯
Am I not good enough for you?
What to do when during a meeting client people start to fight (even physically) with each others?
Is going from continuous data to categorical always wrong?
Running a subshell from the middle of the current command
Is it illegal in Germany to take sick leave if you caused your own illness with food?
Touchscreen-controlled dentist office snowman collector game
What is the difference between "shut" and "close"?
"One can do his homework in the library"
Who is our nearest neighbor
What happens with multiple copies of Humility and Glorious Anthem on the battlefield?
How could a female member of a species produce eggs unto death?
How is the Swiss post e-voting system supposed to work, and how was it wrong?
Is it true that real estate prices mainly go up?
Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?
What is the dot in “1.2.4."
Is having access to past exams cheating and, if yes, could it be proven just by a good grade?
Unreachable code, but reachable with exception
How do anti-virus programs start at Windows boot?
validation vs test vs training accuracy, which one to compare for claiming overfit?
Playing ONE triplet (not three)
Should QA ask requirements to developers?
Deleting missing values from a dataset
Co-worker team leader wants to inject the crap software product of his friends into our development. What should I say to our common boss?
Why does Solve lock up when trying to solve the quadratic equation with large integers?
Why does repeating an equation help in FindRoot?Why does Mathematica fail to solve my equation?How to solve this equation with integers as a solution?Mathematica Solve function does not solve double exponentialEquation is solved quickly using Solve but takes too long using NSolveSolve gives duplicate solutions for a particular equationSolveAlways keeps on loadingSolve an exponential equation in integersUnexpected behaviour with FindInstanceWhy does NDSolve work with an initial condition but not a final condition?
$begingroup$
Why does Solve
lock up when trying to solve the equation
Solve[(x^2+y^2)+(x+y)==2^511 && x>0 && y>0,x,y,Integers]
It works up 2^185
, but at higher powers of 2
, it seems to stop processing. The program says it's running, but there is no solution after running overnight. Running Mathematica 11.3 on Windows 32-bit OS.
equation-solving number-theory diophantine-equations
New contributor
$endgroup$
add a comment |
$begingroup$
Why does Solve
lock up when trying to solve the equation
Solve[(x^2+y^2)+(x+y)==2^511 && x>0 && y>0,x,y,Integers]
It works up 2^185
, but at higher powers of 2
, it seems to stop processing. The program says it's running, but there is no solution after running overnight. Running Mathematica 11.3 on Windows 32-bit OS.
equation-solving number-theory diophantine-equations
New contributor
$endgroup$
1
$begingroup$
You can format inline code and code blocks by selecting the code and clicking thebutton above the edit window. The edit window help button
?
is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful
$endgroup$
– Michael E2
Mar 10 at 18:27
1
$begingroup$
I quickly get solutions for2^257
(V11.3.0, macos).
$endgroup$
– Michael E2
Mar 10 at 18:29
$begingroup$
Sorry, there was a typo - it should be 2^511
$endgroup$
– user63373
Mar 10 at 19:21
1
$begingroup$
Probably it's combinatorial blowup.n = 185
gives 32 solutions butn = 257
already gives 1024. Might be more work and memory to store the symbolics than your CPU can handle.
$endgroup$
– b3m2a1
Mar 10 at 19:38
2
$begingroup$
@b3m2a1 I think the reasons probably have to do with number theory.n = 323
produces 8192 solutions in 2.3s andn = 325
produces only 128 solutions in 500s. The memory growth is quite low. I think forn = 511
, you just have to wait long enough, and I can't predict how long that is.
$endgroup$
– Michael E2
Mar 10 at 19:57
add a comment |
$begingroup$
Why does Solve
lock up when trying to solve the equation
Solve[(x^2+y^2)+(x+y)==2^511 && x>0 && y>0,x,y,Integers]
It works up 2^185
, but at higher powers of 2
, it seems to stop processing. The program says it's running, but there is no solution after running overnight. Running Mathematica 11.3 on Windows 32-bit OS.
equation-solving number-theory diophantine-equations
New contributor
$endgroup$
Why does Solve
lock up when trying to solve the equation
Solve[(x^2+y^2)+(x+y)==2^511 && x>0 && y>0,x,y,Integers]
It works up 2^185
, but at higher powers of 2
, it seems to stop processing. The program says it's running, but there is no solution after running overnight. Running Mathematica 11.3 on Windows 32-bit OS.
equation-solving number-theory diophantine-equations
equation-solving number-theory diophantine-equations
New contributor
New contributor
edited 2 days ago
J. M. is slightly pensive♦
97.9k10304464
97.9k10304464
New contributor
asked Mar 10 at 18:23
user63373user63373
233
233
New contributor
New contributor
1
$begingroup$
You can format inline code and code blocks by selecting the code and clicking thebutton above the edit window. The edit window help button
?
is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful
$endgroup$
– Michael E2
Mar 10 at 18:27
1
$begingroup$
I quickly get solutions for2^257
(V11.3.0, macos).
$endgroup$
– Michael E2
Mar 10 at 18:29
$begingroup$
Sorry, there was a typo - it should be 2^511
$endgroup$
– user63373
Mar 10 at 19:21
1
$begingroup$
Probably it's combinatorial blowup.n = 185
gives 32 solutions butn = 257
already gives 1024. Might be more work and memory to store the symbolics than your CPU can handle.
$endgroup$
– b3m2a1
Mar 10 at 19:38
2
$begingroup$
@b3m2a1 I think the reasons probably have to do with number theory.n = 323
produces 8192 solutions in 2.3s andn = 325
produces only 128 solutions in 500s. The memory growth is quite low. I think forn = 511
, you just have to wait long enough, and I can't predict how long that is.
$endgroup$
– Michael E2
Mar 10 at 19:57
add a comment |
1
$begingroup$
You can format inline code and code blocks by selecting the code and clicking thebutton above the edit window. The edit window help button
?
is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful
$endgroup$
– Michael E2
Mar 10 at 18:27
1
$begingroup$
I quickly get solutions for2^257
(V11.3.0, macos).
$endgroup$
– Michael E2
Mar 10 at 18:29
$begingroup$
Sorry, there was a typo - it should be 2^511
$endgroup$
– user63373
Mar 10 at 19:21
1
$begingroup$
Probably it's combinatorial blowup.n = 185
gives 32 solutions butn = 257
already gives 1024. Might be more work and memory to store the symbolics than your CPU can handle.
$endgroup$
– b3m2a1
Mar 10 at 19:38
2
$begingroup$
@b3m2a1 I think the reasons probably have to do with number theory.n = 323
produces 8192 solutions in 2.3s andn = 325
produces only 128 solutions in 500s. The memory growth is quite low. I think forn = 511
, you just have to wait long enough, and I can't predict how long that is.
$endgroup$
– Michael E2
Mar 10 at 19:57
1
1
$begingroup$
You can format inline code and code blocks by selecting the code and clicking the
button above the edit window. The edit window help button ?
is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful$endgroup$
– Michael E2
Mar 10 at 18:27
$begingroup$
You can format inline code and code blocks by selecting the code and clicking the
button above the edit window. The edit window help button ?
is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful$endgroup$
– Michael E2
Mar 10 at 18:27
1
1
$begingroup$
I quickly get solutions for
2^257
(V11.3.0, macos).$endgroup$
– Michael E2
Mar 10 at 18:29
$begingroup$
I quickly get solutions for
2^257
(V11.3.0, macos).$endgroup$
– Michael E2
Mar 10 at 18:29
$begingroup$
Sorry, there was a typo - it should be 2^511
$endgroup$
– user63373
Mar 10 at 19:21
$begingroup$
Sorry, there was a typo - it should be 2^511
$endgroup$
– user63373
Mar 10 at 19:21
1
1
$begingroup$
Probably it's combinatorial blowup.
n = 185
gives 32 solutions but n = 257
already gives 1024. Might be more work and memory to store the symbolics than your CPU can handle.$endgroup$
– b3m2a1
Mar 10 at 19:38
$begingroup$
Probably it's combinatorial blowup.
n = 185
gives 32 solutions but n = 257
already gives 1024. Might be more work and memory to store the symbolics than your CPU can handle.$endgroup$
– b3m2a1
Mar 10 at 19:38
2
2
$begingroup$
@b3m2a1 I think the reasons probably have to do with number theory.
n = 323
produces 8192 solutions in 2.3s and n = 325
produces only 128 solutions in 500s. The memory growth is quite low. I think for n = 511
, you just have to wait long enough, and I can't predict how long that is.$endgroup$
– Michael E2
Mar 10 at 19:57
$begingroup$
@b3m2a1 I think the reasons probably have to do with number theory.
n = 323
produces 8192 solutions in 2.3s and n = 325
produces only 128 solutions in 500s. The memory growth is quite low. I think for n = 511
, you just have to wait long enough, and I can't predict how long that is.$endgroup$
– Michael E2
Mar 10 at 19:57
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Here's a guess:
The Diophantine problem
$$ x^2+y^2+x+y=a$$
is equivalent, via $u=2x+1,v=2y+1$ to finding the odd solutions to
$$u^2+v^2=2+4a ,.$$
Whether Solve
makes this transformation or not,
solving the Pythagorean equation can be done from the prime factorization of $2+4a$.
How long Solve
takes thus might depend on how long it takes to factor $2+4a$.
This is not hard to verify:
Block[FactorInteger = (Print["FactorInteger"[##]]; Abort[]) &,
PrintTemporary@Dynamic@Clock@Infinity;
Print[2 + 4 2^325];
Solve[(x^2 + y^2) + (x + y) == 2^325 && x > 0 && y > 0, x, y, Integers] // AbsoluteTiming
]
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730
FactorInteger[
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730]
$Aborted
Well, it turns out it takes about 500 sec. to factor 2 + 4 * 2^325
, which is about how long it takes the Solve
above to run.
$endgroup$
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
add a comment |
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: "387"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
user63373 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192994%2fwhy-does-solve-lock-up-when-trying-to-solve-the-quadratic-equation-with-large-in%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
$begingroup$
Here's a guess:
The Diophantine problem
$$ x^2+y^2+x+y=a$$
is equivalent, via $u=2x+1,v=2y+1$ to finding the odd solutions to
$$u^2+v^2=2+4a ,.$$
Whether Solve
makes this transformation or not,
solving the Pythagorean equation can be done from the prime factorization of $2+4a$.
How long Solve
takes thus might depend on how long it takes to factor $2+4a$.
This is not hard to verify:
Block[FactorInteger = (Print["FactorInteger"[##]]; Abort[]) &,
PrintTemporary@Dynamic@Clock@Infinity;
Print[2 + 4 2^325];
Solve[(x^2 + y^2) + (x + y) == 2^325 && x > 0 && y > 0, x, y, Integers] // AbsoluteTiming
]
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730
FactorInteger[
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730]
$Aborted
Well, it turns out it takes about 500 sec. to factor 2 + 4 * 2^325
, which is about how long it takes the Solve
above to run.
$endgroup$
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
add a comment |
$begingroup$
Here's a guess:
The Diophantine problem
$$ x^2+y^2+x+y=a$$
is equivalent, via $u=2x+1,v=2y+1$ to finding the odd solutions to
$$u^2+v^2=2+4a ,.$$
Whether Solve
makes this transformation or not,
solving the Pythagorean equation can be done from the prime factorization of $2+4a$.
How long Solve
takes thus might depend on how long it takes to factor $2+4a$.
This is not hard to verify:
Block[FactorInteger = (Print["FactorInteger"[##]]; Abort[]) &,
PrintTemporary@Dynamic@Clock@Infinity;
Print[2 + 4 2^325];
Solve[(x^2 + y^2) + (x + y) == 2^325 && x > 0 && y > 0, x, y, Integers] // AbsoluteTiming
]
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730
FactorInteger[
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730]
$Aborted
Well, it turns out it takes about 500 sec. to factor 2 + 4 * 2^325
, which is about how long it takes the Solve
above to run.
$endgroup$
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
add a comment |
$begingroup$
Here's a guess:
The Diophantine problem
$$ x^2+y^2+x+y=a$$
is equivalent, via $u=2x+1,v=2y+1$ to finding the odd solutions to
$$u^2+v^2=2+4a ,.$$
Whether Solve
makes this transformation or not,
solving the Pythagorean equation can be done from the prime factorization of $2+4a$.
How long Solve
takes thus might depend on how long it takes to factor $2+4a$.
This is not hard to verify:
Block[FactorInteger = (Print["FactorInteger"[##]]; Abort[]) &,
PrintTemporary@Dynamic@Clock@Infinity;
Print[2 + 4 2^325];
Solve[(x^2 + y^2) + (x + y) == 2^325 && x > 0 && y > 0, x, y, Integers] // AbsoluteTiming
]
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730
FactorInteger[
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730]
$Aborted
Well, it turns out it takes about 500 sec. to factor 2 + 4 * 2^325
, which is about how long it takes the Solve
above to run.
$endgroup$
Here's a guess:
The Diophantine problem
$$ x^2+y^2+x+y=a$$
is equivalent, via $u=2x+1,v=2y+1$ to finding the odd solutions to
$$u^2+v^2=2+4a ,.$$
Whether Solve
makes this transformation or not,
solving the Pythagorean equation can be done from the prime factorization of $2+4a$.
How long Solve
takes thus might depend on how long it takes to factor $2+4a$.
This is not hard to verify:
Block[FactorInteger = (Print["FactorInteger"[##]]; Abort[]) &,
PrintTemporary@Dynamic@Clock@Infinity;
Print[2 + 4 2^325];
Solve[(x^2 + y^2) + (x + y) == 2^325 && x > 0 && y > 0, x, y, Integers] // AbsoluteTiming
]
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730
FactorInteger[
2734063405978764905465627783897026706691461788616515545532213258012441248999219
90402939147127881730]
$Aborted
Well, it turns out it takes about 500 sec. to factor 2 + 4 * 2^325
, which is about how long it takes the Solve
above to run.
answered Mar 10 at 20:38
Michael E2Michael E2
149k12200479
149k12200479
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
add a comment |
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
Thank you very much. This seems to be exactly what is happening. Much appreciated.
$endgroup$
– user63373
Mar 10 at 21:19
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
$begingroup$
@user63373 You're welcome. :)
$endgroup$
– Michael E2
Mar 10 at 22:10
add a comment |
user63373 is a new contributor. Be nice, and check out our Code of Conduct.
user63373 is a new contributor. Be nice, and check out our Code of Conduct.
user63373 is a new contributor. Be nice, and check out our Code of Conduct.
user63373 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica 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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192994%2fwhy-does-solve-lock-up-when-trying-to-solve-the-quadratic-equation-with-large-in%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
$begingroup$
You can format inline code and code blocks by selecting the code and clicking the
button above the edit window. The edit window help button
?
is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful$endgroup$
– Michael E2
Mar 10 at 18:27
1
$begingroup$
I quickly get solutions for
2^257
(V11.3.0, macos).$endgroup$
– Michael E2
Mar 10 at 18:29
$begingroup$
Sorry, there was a typo - it should be 2^511
$endgroup$
– user63373
Mar 10 at 19:21
1
$begingroup$
Probably it's combinatorial blowup.
n = 185
gives 32 solutions butn = 257
already gives 1024. Might be more work and memory to store the symbolics than your CPU can handle.$endgroup$
– b3m2a1
Mar 10 at 19:38
2
$begingroup$
@b3m2a1 I think the reasons probably have to do with number theory.
n = 323
produces 8192 solutions in 2.3s andn = 325
produces only 128 solutions in 500s. The memory growth is quite low. I think forn = 511
, you just have to wait long enough, and I can't predict how long that is.$endgroup$
– Michael E2
Mar 10 at 19:57