Charles Greathouse on Sat, 14 Mar 2026 15:24:06 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: S-Unit questions


I think an efficient S-unit solver would be very useful (I’d use it, at least), but it seems like a huge ask.

On Sat, Mar 14, 2026 at 5:48 AM <hermann@stamm-wilbrandt.de> wrote:
Below SageMath solver run for S={2,3} took less than 5 minutes.
I tried with S={2,3,5,7} and aborted after 22.5h on AMD 7950X CPU with
boost frequency 5.4GHz run.
https://gist.github.com/Hermann-SW/b538c991c922b1e8fc06abbab554b3ef?permalink_comment_id=6027812#gistcomment-6027812
Then I tried with S={2,3,5} and aborted after 13.5h.

Since SageMath S-Unit equation solver is not efficient,
an efficient PARI/GP solution somehow would be desirable:
https://en.wikipedia.org/wiki/S-unit#S-unit_equation

Regards,

Hermann.

On 2026-03-12 21:56, hermann@stamm-wilbrandt.de wrote:
> On 2026-03-12 16:09, hermann@stamm-wilbrandt.de wrote:
>>
>> The number of solutions to S-Unit equation (u+v=1, u,v S-Units)
>> https://en.wikipedia.org/wiki/S-unit#S-unit_equation
>>
>> is finite. That section also says such a solver can be found here, I
>> will try:
>> https://en.wikipedia.org/wiki/SageMath
>>
> Never used SageMath before, and it took many iterations with Gemini to
> get error free code.
> I changed to use ℚ instead of ℚ(i) and added generator output:
> https://gist.github.com/Hermann-SW/b538c991c922b1e8fc06abbab554b3ef
>
> hermann@7950x:~$ time Downloads/SageMath-10.8-x86_64.AppImage
> S-Unit.sol.sage
> Generators:
> -1
> 2
> 3
> Found 11 solutions:
> 2 + -1 == 1
> --------------------
> -1/8 + 9/8 == 1
> --------------------
> 1/9 + 8/9 == 1
> --------------------
> 3 + -2 == 1
> --------------------
> 4 + -3 == 1
> --------------------
> 3/4 + 1/4 == 1
> --------------------
> 1/3 + 2/3 == 1
> --------------------
> 4/3 + -1/3 == 1
> --------------------
> -1/2 + 3/2 == 1
> --------------------
> -8 + 9 == 1
> --------------------
> 1/2 + 1/2 == 1
> --------------------
>
> real  4m45.409s
> user  4m46.018s
> sys   0m0.187s
> hermann@7950x:~$
>
>
> Regards,
>
> Hermann.