Questions tagged [diophantine-equations]

Questions on the use of Mathematica to find integer/rational solutions to equations.

Filter by
Sorted by
Tagged with
1 vote
0 answers
73 views

Solving Diophantine Equation with Only Specific Variable Values Allowed

I am trying to Solve an equation like this: $$ \sum _{i=1}^{\text{iMax}} (-i+\text{iMax}+1) n(i)=546 $$ Where all the $n(i)$ are can only take on the values 2,3,6,7, or 8. I really have no idea how to ...
ydd's user avatar
  • 2,644
0 votes
1 answer
68 views

Finding coprime solutions to Diophantine equations

I'm hoping to use Mathematica to find solutions to Diophantine equations. Below is a toy example of something I would like to try. Consider the case of $$x^2+y^2 = 17$$ which has the solution $x=1,y=4$...
user196574's user avatar
3 votes
1 answer
170 views

Extremum of the graph of a function has integer coordinates

Graph of the fuction $y=\dfrac{(x-26)(x+9)}{(x+14)(x+19)}$ has maximum point and minimum point are (-16,-49) and (-4,-1) whose ...
Laurenso's user avatar
  • 844
1 vote
2 answers
85 views

Solving a-two-variable equation in primes

How solve the following equation in Mathematica (preferably in one line) for pairs of $(x,y)$ such that $x$ and $y$ are primes? $x^3-y^4=1$
Rebel's user avatar
  • 115
2 votes
2 answers
360 views

How can I find all integer numbers so that mydistance is an integer number?

I am tring to selec two points A, B on the sphere (x-2)^2 + (y-4)^2 + (z-6)^2 ==9^2 so that EuclideanDistance[pA,pB] is an ...
John Paul Peter's user avatar
10 votes
3 answers
878 views

How can I select four points on a sphere to make a regular tetrahedron so that its coordinates are integer numbers?

I want to select four points lie on the sphere (x-1)^2 + (y-3)^2 + (z-5)^2 = (5* Sqrt[3])^2 so that its coordinates are integer numbers to make a regular ...
Laurenso's user avatar
  • 844
8 votes
3 answers
382 views

How can I get all squares on this sphere so that its coordinates are integer numbers?

I have the sphere (x-2)^2 + (y-4)^2 + (z-6)^2 = 15^2. I want to select all squares on this sphere so that its coordiantes are twelve different integer numbers like ...
Laurenso's user avatar
  • 844
5 votes
2 answers
218 views

How can I find four points on a circle to make a square so that its coordinates are integer numbers?

I have a circle and I want to select four points to make a square so that its coordiantes are eight different integer numbers like this ...
Laurenso's user avatar
  • 844
1 vote
1 answer
99 views

Parametric integer solution of $aX^2+bY^2-cZ^2=0$

Let $a,b,c\in \mathbb{Z^+}$ and unknowns $X,Y,Z\in \mathbb{Z}$. How can I get the parametric solution $(X,Y,Z)$ of equation $$aX^2+bY^2-cZ^2=0$$ in Mathematica? In pari/gp, this solution can be ...
Dmitry Ezhov's user avatar
3 votes
2 answers
221 views

How can I reduce the time to compile this solve?

I want to find five integer numbers $a, b, c, d, e$ so that $a+ b+ c + d + e = 9 k$ and none of two number in which are equal. I tried. ...
John Paul Peter's user avatar
20 votes
4 answers
942 views

Optimize search for rational numbers on unit circle?

Crossposted: https://community.wolfram.com/groups/-/m/t/2763509 I'd like to classify rational numbers on a unit circle by the following property: number of digits in the denominator. It relates to an ...
Vitaliy Kaurov's user avatar
2 votes
4 answers
258 views

Number of solutions in natural numbers $a+b+c+d=13$

I would appreciate it if somebody could help me with the following problem: Q: To find the number of ordered pairs of natural numbers in the following equation $$a+b+c+d=13$$ we want to add the ...
Young's user avatar
  • 259
2 votes
1 answer
173 views

Solving a quadratic equations over integers efficiently

I want to solve a quadratic equation over the integers but the naive method is unbearably slow (considering how easy the problem is). I have a positive non-degenerate quadratic form $Q$ on $\mathbb Z^...
David Jaramillo's user avatar
4 votes
3 answers
595 views

How to find integer solution of this equation?

I am trying to find pairs of integers $(x,y)$ $(x >0, y >0)$ satisfying $$(x + y) (5 x + y)^3 + x y^3 = (5 x + y)^3 + x^2 y^3 + x y^4 $$ I tried ...
minhthien_2016's user avatar
2 votes
0 answers
81 views

Thue equations solving with Reduce

Could somebody tell me whether Reduce assumes (or not) the GRH when solving Thue equations? Given its performances (related to timing) compared to PARI/GP when the "GRH assumed" flag is set ...
Michel ROBERT's user avatar
3 votes
1 answer
142 views

How can I solve this system of 6 simple quadratic diophantine equations in four variables?

I generated this text file containing tuples $(\sqrt{s}, \sqrt{t}, \sqrt{u}, s,t,u,t+u,t+u-s,t-s)$ where the six variables $s,t,u,t+u,t+u-s,t-s$ are all squares. An excerpt of the data set is: ...
Eldar Sultanow's user avatar
1 vote
0 answers
85 views

Conjugate Puiseux expansions in Mathematica

In a paper "A quantitative version of Runge’s theorem on diophantine equations" ACTA ARITHMETICA LXII.2 (1992), P. G. Walsh developed a method to solve all 2-variable diophantine equations ...
Bogdan's user avatar
  • 11
0 votes
2 answers
179 views

Finding all solutions to coupled algebraic equations without exhaustive enumeration

A Cambridge University mathematics interview question states: Find all $a,b,c,d,e,f \in \mathbb{N}$ such that $$a + b + c = d \cdot e \cdot f$$ and $$d + e + f = a \cdot b \cdot c$$ (There are a ...
David G. Stork's user avatar
5 votes
2 answers
525 views

Solving an equation over the integers

Consider the problem of finding all values of $n \in \mathbb{N}$ s.t. $$\sqrt{n} + \sqrt{n + 2005}$$ is an integer. One can easily verify that $n = 1,004,004$ and $39,204$ satisfy this requirement, ...
David G. Stork's user avatar
0 votes
1 answer
66 views

Find a solution to a congruence within a specified range

My problem is to find all the integer solutions of the following conguence: $$P=0\ \text{mod}\ 4$$ where $$p=q^2∗r^2∗y^4∗z^2∗(2∗w^4+2∗r^2∗w^4∗y^4∗z^2+r^2∗w^8∗y^4∗z^2+2) + q^2+ 2∗r^6∗w^4∗y^m∗z^6∗(w+w^2+...
Safwane's user avatar
  • 121
1 vote
0 answers
61 views

Why does `FindInstance` refuse to find a second instance, in a number theory problem?

Hi I am looking for reversible Markov generating matrices of order three, whose upper (2,2) block has integer eigenvalues. There are 5 free parameters; I specified 2 ...
florin's user avatar
  • 1,582
2 votes
1 answer
77 views

Strange results from FrobeniusSolve

As part of pruning for my code searching for optimal addition chains I want to try and find some fast ways to discover that certain numbers are not representable in the Frobenius coin problem. An ...
Neill Clift's user avatar
3 votes
2 answers
159 views

Diophantine inequality that's not solved

Mathematica has trouble solving this Diophantine inequality: ...
fgrieu's user avatar
  • 438
0 votes
1 answer
50 views

How do I find the solution of a system of Diophantine equations in two variables? [closed]

If the first equation is 2x+y=152, and the second is x+2y=100, and it is a fact that both variables are whole numbers and x is larger than y, what is the value of x?
asheburned's user avatar
2 votes
2 answers
117 views

Solving a diophantine equation in 'large' values

Let's first discuss what I am trying to solve: I want to solve the diophantine equation stated below for relatively 'large' values of $r$. $$\frac{a(a + 3)(a(r - 9) + (7 - r))}{12}=\frac{b (3 + b (-5 +...
Jan Eerland's user avatar
  • 1,941
0 votes
1 answer
1k views

Linear diophantine equation

How to use Mathematica to solves any linear diophantine equation of the form ax+by=c, whenever it is solvable. Such as this example, How to get the x = -165, y = 238. Thanks! Link: https://mathworld....
User796's user avatar
  • 47
3 votes
4 answers
578 views

Solving an equation in natural numbers

I am trying to solve the following equation in the Natural Numbers, with the condition $a\ge1$, $b\ge1$, and $r\ge3$: $$\frac{a(a + 3)(a(r - 5) + (12 - r))}{9}=\frac{b (9 + b (-14 + r) - r)}{3}\tag1$$ ...
Jan Eerland's user avatar
  • 1,941
2 votes
1 answer
86 views

How to write this simple task of unimodular prime search in mathematica?

For testing a particular algorithm I found mathematica is the best way as it has all the tools I need. I am stuck in a number theory part and since I am not an expert in mathematica I do not know how ...
Turbo's user avatar
  • 135
0 votes
1 answer
53 views

how to solve a quadratic diophanic equation on integers and obtain various results

This quadratic di equation has more results, as it came to them. I can only think of this FindInstance[(4 p + 3 q - 2) (p - 1) == (6 p + 2 q) q, {p, q}, Integers] ...
zeros's user avatar
  • 2,247
0 votes
2 answers
111 views

Solving a system of equations using the data generated by PowersRepresentations and ParallelTable

First of all, it is possible to check the code that I am asking for because I know that $x=3051$ must yield at least a solution to the problem. Well, I have the following system of equations: Now, I ...
Jan Eerland's user avatar
  • 1,941
1 vote
1 answer
81 views

Solving a system of two equations of cube integers using ParallelTable

Well, I have the following problem: I need to solve the following system of equations: $$ \begin{cases} n=a^3+b^3+c^3\\ \\ n=d^3+k^3+f^3 \end{cases}\tag1 $$ Where: $n\ne a\ne b\ne c\ne d\ne k\ne f$;...
Jan Eerland's user avatar
  • 1,941
3 votes
1 answer
289 views

Find integers $a, b, c, d, m, n, p$ so equation has six distinct solutions

By hand, I found that the equation $$ \left| -2 x+5\right| +\left| -2 x+9\right| -x^2+7 x-16=0 $$ has six solutions $1, 2, 3, 4, 5, 6$. Another equations I want to find a set of integers $a, b, c, ...
minhthien_2016's user avatar
4 votes
2 answers
241 views

One more solution of the Mordell equation

Please, help to find one more solution of the Mordell equation $y^2=x^3+n,\quad n\in\mathbb{Z}$ $$y^2=x^3-307$$ Using Solve I was able to go up to ...
yarchik's user avatar
  • 17.5k
9 votes
3 answers
477 views

Calculating the integral points of an elliptic curve

I asked this question on Math stachexchange. The question I have is: Can I use Mathematica to find the (integral points on the following elliptic curve) or can I find when the number $\text{n}$ is a ...
Jan Eerland's user avatar
  • 1,941
1 vote
1 answer
137 views

Possible way to plot the solution density of diophantine equations

Well, I'm trying to investigate the density of solutions to Diophantine equations. What is a general method to describe that density? I've two functions: $$\varphi\left(\text{a},\text{b},\text{c}\...
Jan Eerland's user avatar
  • 1,941
2 votes
2 answers
157 views

Finding a program that can find integer solutions for large values of a variable

I've the following code: ...
Jan Eerland's user avatar
  • 1,941
2 votes
0 answers
74 views

Never terminating when solving linear Diophantine systems

Say I have: $(1):$ Set of Diophantine systems where each defines a (possibly unbounded) polyhedron. This is solvable with existing algorithms: $(*):$ The $(1)$ can be solved in SageMath with ...
Vepir's user avatar
  • 622
-1 votes
1 answer
76 views

Quadratic equation with integral coefficients [closed]

Let $a,b,c $ be Natural Numbers, such that roots of the equation $ax^2+bx+c=0$ are distinct and both lie in the interval (0,1) (1,2) (2,3) (Brackets signify open interval, roots are $IN BETWEEN $ ...
user10595795's user avatar
4 votes
1 answer
900 views

Why does Solve lock up when trying to solve the quadratic equation with large integers?

Why does Solve lock up when trying to solve the equation ...
user63373's user avatar
2 votes
4 answers
306 views

FrobeniusSolve with solutions only being 0 or 1 being acceptable

I want an EFFICIENT way of solving the Frobenius Equation a1 n1 + a2 n2 + a3 n3 + ... + aK nK = U where n1, n2, ..., nK are restricted to be either 0 or 1. I ...
Quasar Supernova's user avatar
3 votes
4 answers
248 views

How do I declare a countably infinite list of variables as being integers?

I want to do this, Solve[ { n1 + n2 + n3 + .... = 10, n1 + 2 n2 + 3 n3 + .... = 100}, {n1,n2,n3,....}, Assumptions -> {n1,n2,n3,.... are Integers >=0} ] ...
Quasar Supernova's user avatar
2 votes
2 answers
142 views

On the solvability of the Diophantine equation $a(x^2-y^2)+2bxy=1$

Take two integers $a,b$ with $\mathrm{GCD}(a,b)=1$ and $a$ odd. Consider the Diophantine equation $$ a(x^2-y^2)+2bxy=1,\qquad x,y\in\mathbb Z $$ Is there any efficient way to determine whether such ...
AccidentalFourierTransform's user avatar
0 votes
1 answer
137 views

Unexpected omission by Wolfram Alpha [closed]

When Alpha is submitted the equation $a(a^2-1)=2b^2$, it unexpectedly forgets the integer solution $a=1,b=0$. What could explain this ? http://www.wolframalpha.com/input/?i=a(a%5E2-1)%3D2b%5E2
Yves Daoust's user avatar
4 votes
2 answers
792 views

How can I reduce the time to run this code?

I am trying to find the integers $ a, b, c, d \in [-15, -1] \cup [1, 15] $ so that the equation $ \left| x^2 + a x + b \right| = c x + d $ has four distinct integeral solutions different from $ 0 $. ...
minhthien_2016's user avatar
5 votes
1 answer
326 views

Pythagorean quadruples

I am very interested in the problem that deals with the Pythagorean quadrruples, which are listed in rosettacode. Unfortunately, I have not been able to find any way to compute them with Mathematica. ...
bullitohappy's user avatar
  • 1,239
3 votes
1 answer
108 views

Guess Diophantine equation from its solutions

Take for example the equation $$ n^2=x^2+y^2+1 $$ where $x,y$ are integers. This equation admits solutions only for some values of $n$, to wit, $$ n=1,3,9,17,19,33,35,51,73,81,99,\dots $$ Can we ...
AccidentalFourierTransform's user avatar
1 vote
1 answer
430 views

How do we show reduction steps?

This produces 3 equivalent Diophantine equations. How can we show the reduction steps? I need to do this for a paper. ...
Fred Daniel Kline's user avatar
4 votes
3 answers
644 views

Finding Smallest Positive Solution to Diophantine Equation

Mathematica can solve $v^2- d u^2=4$ quickly, even for nonsmall $d$: d = 400004; Reduce[v^2 - d u^2 == 4, Integers] d = 400012; Reduce[v^2 - d u^2 == 4, Integers] ...
Kevin O'Bryant's user avatar
4 votes
3 answers
737 views

Solving a system of diophantine equations from a mathematical competition

There is a problem from the $66th$ Putnam Mathematical Competition, $B2$ Find all positive integers $n,k_1,k_2,...,k_n$ such that $$k_1+\cdots+k_n=5n-4$$ and $$\frac{1}{k_1}+\cdots+\frac{1}{...
vito's user avatar
  • 8,848
-3 votes
2 answers
432 views

Solving a diophantine equation with three variables

Solve this equation using Mathematica: $2^x + 113^y = z^2$, $\operatorname{gcd}(x, y) = 1$.
Shivangi Asthana's user avatar