Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [diophantine]

The tag has no usage guidance.

diophantine
1 vote
0 answers
81 views

Integer solutions for equation with approximated real variable

I'm trying to solve an equation of the kind: f1(x)*m^2 + f2(x)*m*n + f3(x)*n = 0. f1, f2, f3 are known linear functions with rational coefficients, x is inside the closed known interval [x_0, x_1] of ...
Emu's user avatar
  • 11
4 votes
1 answer
211 views

How would I solve a linear Diophantine congruence in Python?

I was given a challenge where the solution involves solving a series of linear modular equations in 14 variables. The following is a selection of these equations: 3a + 3b + 3c + 3d + 3e + 3f + 3g + h +...
Josiah Winslow's user avatar
-1 votes
1 answer
535 views

How to determine reachable states in 3 water jug problem?

Consider 3 water jugs 1,2,3 with capacities 12,8,5 respectively. The total water held by the 3 jugs should be 12 units. We can either empty jug x into jug y (xEy) or fill up jug y from jug x (xFy). ...
Awe Kumar Jha's user avatar
0 votes
1 answer
70 views

Python code to find the integer solutions of multivariable cubic equation (Diophantine equation)?

My equation is a multivariable cubic equation, and I want to find its integer solutions in a given interval x = range(-10,11). The equation is a3 + b3 + c3 + d3 + e3 - (a + b + c + d + e)3 = 0 Is the ...
epsilon's user avatar
0 votes
0 answers
44 views

Why does the SymPy diophantine module occasionally return a solution for an expression in some symbols, but not for the same expression in others?

Having imported the following: from sympy.solvers.diophantine.diophantine import diop_ternary_quadratic from sympy.abc import x,y,z,d,h,c Running the code diop_ternary_quadratic(-7938*x**2+14436*x*y-...
Benjamin Vakil's user avatar
2 votes
3 answers
163 views

Counting number of integer solutions of z³ = x²y² for given z

I have been working on this problem for some time now. The problem asks to find two numbers x and y such that the product of the squares of x and y equal the cube of k. My approach was to solve for x, ...
Hooahclitus's user avatar
0 votes
0 answers
66 views

Calculating Third Divisor on a HyperElliptic Curve in a Finite Field

I have been working on a program that Calculates the third divisor, D3, on a HyperElliptic curve given D1 and D2 in a FINITE FIELD. I have taken many approaches and have decided on using Cantors ...
Jordan De Sotle's user avatar
0 votes
0 answers
235 views

Fastest way to solve non-negative linear diophantine equations

Let A be a list of n lists of m non-negative integers, such that for all j there is i with A[i][j] nonzero. Let V be a list of m positive integers. Question: What is the fastest way to find all the ...
Sebastien Palcoux's user avatar
2 votes
1 answer
158 views

Linear Diophantine Equations with Restriction in the GAP System

I am searching for a way to use the GAP System to find a solution of a linear Diophantine equation over the non-negative integers. Explicitly, I have a list L of positive integers for each of which ...
Dylan C. Beck's user avatar
0 votes
2 answers
487 views

I want sympy gcdex(ax + by = c This is a linear Diophantine equation.)

I want to cal https://en.wikipedia.org/wiki/Diophantine_equation#Examples ax + by = c This is a linear Diophantine equation. i try I think the way you substituted h is not good. How should I fix it? x,...
mrrclb46z's user avatar
0 votes
2 answers
517 views

Solving a Diophantine [closed]

I was given the task to solve the graded Diophantine problem. McDonald’s sells Chicken McNuggets in packages of 6, 9 or 20 McNuggets. Thus, it is possible, for example, to buy exactly 15 McNuggets (...
Interpreter's user avatar
0 votes
1 answer
134 views

Diophantine Equation

that takes a number (n) as an argument and returns tuple of four numbers which are; total number of packages, the number of packages of 6 nuggets, the number of packages of 9 nuggets and the number of ...
Interpreter's user avatar
0 votes
1 answer
241 views

How can we solve a system of quadratic diophantine equations efficiently unsing Python?

I am investigating/evaluating technical ways to solve quadratic diophantine systems of equations. My concrete problem can be boiled down into the following two steps: Loading a Textfile that contains ...
Eldar Sultanow's user avatar
1 vote
1 answer
736 views

Solution for equation of a line with 2 variables ax + by = c works in one case but fails in other case

I am trying to solve ax + by = n. When I put n = 7, it solves the equation correctly as X = 2 and Y = 1. But when I put n = 1, it does not solve the equation. Even though, this equation has valid ...
Ganesh Kamath - 'Code Frenzy''s user avatar
0 votes
1 answer
45 views

Why the program does not correctly search for the general solution of the Diophantine equation

I wrote a program that looks for a general solution to a Diophantine equation, but the solution is not entirely correct when I check the online calculator. For example, for the equation "45x-128y=...
aspcartman111's user avatar

15 30 50 per page