Status of the Diophantine Equation

10 views
Skip to first unread message

Thilina Rathnayake

unread,
Sep 9, 2013, 1:30:26 PM9/9/13
to sy...@googlegroups.com
Hi Ondrej,

I implemented solutions to the general sum of squares. That is to the equations
of the form x_1**2 + x_2**2 + . . .  + x_n**2 = k. I made a commit. Please take a
look at the following PR. The new function is named `diop_general_sum_of_squares()`
and it's hooked to `diop_solve()` and `diophantine()`.

https://github.com/sympy/sympy/pull/2432

Currently, the function returns only one solution and this is fast. According to the
sources I referred, Finding all the solutions is exponential in `k` and closely related
to subset-sum problem. More than one solution can be found by using `power_representation()`
described below but it's a brute and doesn't work for large `k`.

I implemented a more general function which solves x_1**p + x_2**p + . . . + x_k**p = n
It is named as `power_represenatation()` and takes three arguments n, k, and p as in
above equation. I didn't hook it to the `diop_solve()` or `diophantine()`. I am doing a bit of
research on how I can improve this function. Even Wolfram Alpha doesn't have efficient solution
to this problem, for sufficiently large `n`, it gives a message saying standard computation time exceeded.

I implemented several functions like sum_of_three_squares() and sum_of_four_squares()
which were needed to solve some of the Diophantine equations but these functions naturally belong
under an Additive number theory module. Then, I can import these functions from it and use in the
Diophantine equation module. I expect to create an additive number theory module for SymPy but it will
be after I finish GSoC.

I will start on the two issues you created from tomorrow. I was a bit busy during the last week since
I was stuck with university work, Hope to cover for that in this week.

Regards,
Thilina.
Reply all
Reply to author
Forward
0 new messages