Questions tagged [diophantine-equations]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
29 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+...
1
vote
0answers
44 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 ...
2
votes
1answer
59 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 ...
3
votes
2answers
108 views

Diophantine inequality that's not solved

Mathematica has trouble solving this Diophantine inequality: ...
0
votes
1answer
42 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?
2
votes
2answers
98 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 +...
0
votes
1answer
139 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....
3
votes
4answers
382 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$$ ...
2
votes
1answer
82 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 ...
0
votes
1answer
43 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] ...
0
votes
2answers
100 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 ...
1
vote
1answer
73 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$;...
3
votes
1answer
244 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, ...
4
votes
2answers
195 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 ...
7
votes
3answers
309 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 ...
0
votes
1answer
95 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}\...
2
votes
2answers
140 views

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

I've the following code: ...
2
votes
0answers
62 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 ...
-1
votes
1answer
62 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 $ ...
4
votes
1answer
885 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 ...
2
votes
4answers
252 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 ...
3
votes
4answers
193 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} ] ...
2
votes
2answers
129 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 ...
0
votes
1answer
131 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
4
votes
2answers
763 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 $. ...
3
votes
1answer
102 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 ...
1
vote
1answer
213 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. ...
4
votes
3answers
458 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] ...
3
votes
3answers
663 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}{...
-3
votes
2answers
375 views

Solving a diophantine equation with three variables

Solve this equation using Mathematica: $2^x + 113^y = z^2$, $\operatorname{gcd}(x, y) = 1$.
7
votes
2answers
186 views

Unexpected behaviour with FindInstance

Evaluating FindInstance[a/(b + c) + b/(a + c) + c/(a + b) == 4, {a, b, c}, Integers] does what I'd expect it to do: find a solution to the equation in integers. ...
2
votes
1answer
164 views

Storing Multiple solutions from Solve as rows of a matrix

I am trying to find all the solutions to a Diophantine equation (only integer valued solutions) using Solve[], however there are multiple and even many solutions sometimes. How can I store these ...
1
vote
2answers
529 views

determine the coefficients of a quadratic equation with “Solve”

Assume we want to determine the coefficients (integer) of a quadratic equation by having some information about the input and output values. If I enter the input and output individually before the ...
5
votes
1answer
560 views

Solving a Diophantine equation with a large solution

I am trying to solve the following Diophantine equation with Mathematica: $\frac{x}{y+z}+\frac{z}{x+y}+\frac{y}{x+z}=4$ It is known that there are three positive numbers that satisfy the equation ...
2
votes
0answers
72 views

Introducing constraints in FrobeniusSolve

I have a knapsack problem. Say I have N possible items $x_i$. I would like to know: $ \sum_{i=0}^{2} c_i x_i = W$ With the following constraint: $c_i=3 \lor 4$ As an example suppose the set $x_i=...
2
votes
0answers
174 views

How to test solvability of a Diophantine equation?

When applying the BRC theorem I need to test if an equation has a non-zero solution in integers. The equation is of form: $$x^2 + by^2 + cz^2 = 0$$ We could try to directly check if this equation ...
2
votes
2answers
285 views

Integer partitions without repetitions

What combination of numbers makes a specific sum? The code below is not very effective, because it also gives answers in which a number is used more than once even though it was given in the list ...
5
votes
2answers
140 views

Finding all solutions in the Roth's theorem

Roth's theorem. For all algebraic irrational $\alpha$ $$\displaystyle \left \lvert \alpha - \frac{p}{q} \right \rvert < \frac{1}{q^{2 + \epsilon}}$$ with $\epsilon>0$, has finitely many ...
16
votes
5answers
2k views

Puzzle — 20 People to consume 20 units of food under constraints

I am learning Mathematica because I love it. I also love solving puzzles so I think it would be a nice way to learn Mathematica through puzzles. This is first puzzle in series I intend to solve. So ...
0
votes
1answer
562 views

Solving Diophantine equations

Given a complex number $z$ and a positive integer $n$, I would like to be able to find integer solutions $\alpha,\beta,\gamma$ to the Diophantine equation $$0 < a^2\vert z \vert^2 + \beta\textrm{ ...
4
votes
3answers
295 views

find and count the number of solutions without multiplicity in Solve?

I would like to solve a Diophantine equation and find its solution, but I need only count one time for each $a$, i.e., when for some $a$ it found some $x,y,z$, then go to the next $a$. more precisely ...
2
votes
2answers
306 views

Solve an exponential equation in integers

Find two integers x and y such that $x^y +y^x = 94032$. I have used ...
20
votes
3answers
937 views

Partitioning a number into consecutive integers

Consider n=45; then $$1+2+3+4+5+6+7+8+9=45$$ $$5+6+7+8+9+10=45$$ $$7+8+9+10+11=45$$ $$14+15+16=45$$ $$22+23=45$$ Question: how to find all representations of a ...
1
vote
0answers
96 views

diophantine linear equation with condition on the sum of coefficients [closed]

I am trying to solve the following diophantine equation x*a + y*b == c where a,b,c are integers and the absolute value of their sums is, for instance, 4. Then I ...
2
votes
2answers
357 views

how to find sum of variable c1+c2+c3 for expression combinations

how to find sum of variable c1 + c2 + c3 for expression combinations: ...
5
votes
3answers
215 views

On Solutions of Diophantine Equation

By Mathematica, I try to obtain solutions of Diophantine equations such as: $$F_{n_1}F_{n_2}\cdots F_{n_k}+1=F_t$$ where the sequence $\{F_n\}$ is the Fibonacci sequence,$n_1 < n_2 < \cdots &...
6
votes
1answer
124 views

Find out whether solutions exist rather than full-blown solution search

I have some quadratics, and I am trying to find out whether there exist solutions in the integers. The following tells me that the first does, wheraeas the second doesn't: ...
4
votes
4answers
1k views

How to merge permutations obtained from Solve on multiple variables?

When I compute the following expression to find integer solutions of the equation (x^2 + y^2 + z^2 == 14^2) ...
3
votes
2answers
289 views

Diophantine equation: getting a list of solutions for each coeficient

I'm trying to solve the following diophantine equation,$$x^3+dy^3=1$$ such that $$x,y \in \mathbb{Z} \land y \neq 0$$ and I want to form a list of solutions for each $$d\in[1,1000]; d\in\mathbb{N}$$ ...
5
votes
2answers
270 views

Optimization problems over the Integers

Should be an easy question. How can I define a function which gets only integers in a form that I can use to find max and min for instance? Example: Find the Max of the expression ...