Questions on the use of Mathematica to find integer/rational solutions to equations.
10
votes
6answers
395 views
How to find lattice points on a line segment?
How do I find points on the line segment joining {-4, 11} and {16, -1} whose coordinates are positive integers?
8
votes
2answers
227 views
Is there a way to use functions like Prime[n] within Solve[]?
I'm trying to see if a number can be written as the sum of two prime numbers. Ideally, I would like to use
Solve[Prime[n] + Prime[m] == 100, {n, m}]
But that ...
8
votes
1answer
158 views
Efficient way to solve equal sums $x_1^k+x_2^k+\dots+x_5^k=y_1^k+y_2^k+\dots+y_5^k$ with Mathematica?
I need to solve the system of equations, call it $S_1$, in the integers
$$x_1x_2x_3x_4x_5 = y_1y_2y_3y_4y_5$$
$$x_1^k+x_2^k+\dots+x_5^k=y_1^k+y_2^k+\dots+y_5^k,\;\; k= 2,4,6$$
I used a very ...
7
votes
3answers
530 views
Finding the number of solutions to a diophantine equation
I want to count total number of the natural solutions (different from 0) of the equation $2x + 3y + z = 100$, but don't know how. How can I calculate it using Mathematica? I tried:
...
7
votes
4answers
261 views
Defining a Unique Domain for Solving Diophantine Equations
I am working on a research problem in discrete geometry to do with sphere packings, and believe it or not, I have been able to reduce it to finding the solutions to the Diophantine equation,
$$n = ...
7
votes
2answers
323 views
Solving/Reducing equations in $\mathbb{Z}/p\mathbb{Z}$
I was trying to find all the numbers $n$ for which $2^n=n\mod 10^k$ using Mathematica.
My first try:
Reduce[2^n == n, n, Modulus -> 100]
However, I receive ...
4
votes
2answers
290 views
How can I solve the equation with integers as a solution?
I want to solve the equation $$(x-1)^2 + (y-1)^2 + (z-1)^2 = 49$$ where $x$, $y$, $z$ are integer and $x \neq 1$, $y \neq 1$, $x \neq 1$. How do I tell Mathematica to do that?
4
votes
0answers
90 views
Computing Ehrhart's polynomial for a convex polytope
Is there a Mathematica implementation for computing the Ehrhart polynomial of a convex polytope which is specified either by its vertices or by a set of inequalities?
I am interested in knowing this ...
3
votes
1answer
278 views
How to solve this equation with positive integers as a solutions?
This is a problem of United Kingdom Mathematical Olympiad. Find all triples $(x,y,z)$ of positive integers such that
$$\biggl(1+\dfrac{1}{x}\biggr)\cdot \biggl(1+\dfrac{1}{y}\biggr)\cdot ...
3
votes
2answers
81 views
Extracting Reduce results
I'm solving a Diophantine equation inside of a function using Reduce but I'm having trouble extracting the necessary parts of the answer.
For example, if my input ...
2
votes
1answer
140 views
How to solve this equation with integers as a solution?
I want to solve the equation $$x^y + y = y^x + x$$
with $x$, $y$ are integer numbers. I tried
Solve[x^y + y == y^x + x, {x, y}, Integers]
How to solve the ...
2
votes
2answers
59 views
How do I generate a set of n-tuples containing integral solutions to a linear equation provided certain constraints?
Let $m,k,p$ be fixed positive integers. I want to create a table of k-tuples $(x_1,x_2,\ldots,x_k)$ comprised of solutions in positive integers to the equation below:
...
1
vote
1answer
126 views
Using 'Reduce' to solve a set of inequalities, specified by a list
I have a two lists $LHS$ and $RHS$, both of size $n$. I want to solve a system of inequalities of the form:
$$LHS[1] \leq RHS[1]$$
$$LHS[2] \leq RHS[2]$$
$$LHS[3] \leq RHS[3]$$
$$\vdots$$
...
