Questions tagged [diophantine-equations]

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

Filter by
Sorted by
Tagged with
9
votes
3answers
3k 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: ...
10
votes
2answers
1k 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 ...
14
votes
6answers
5k 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?
6
votes
3answers
281 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: $$x_1+x_2+\cdots+x_k=m\quad\...
11
votes
3answers
586 views

FindInstance with a Diophantine equation seems to go on forever

I tried to find a non-trivial integer solution to the equation $$2012^2=a^2+b^2+c^2+d^2+e^2$$ with Mathematica but the computation takes minutes; I might be doing something wrong. ...
5
votes
1answer
384 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
4answers
190 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 ...
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 ...
6
votes
2answers
145 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. ...
14
votes
2answers
629 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 ...
3
votes
4answers
165 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} ] ...
3
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
310 views

Solving a diophantine equation with three variables

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