Re: S-Unit questions

Charles Greathouse <[email protected]> Sat, 14 Mar 2026 10:23:52 -0400
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <CANXmBjwGK0Wr8+V5evfvpuhuUEkMv-dk++5U7zQ=ss+2zvEoZQ@mail.gmail.com>
--000000000000cfdeb5064cfcbc15
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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

On Sat, Mar 14, 2026 at 5:48=E2=80=AFAM <[email protected]> wrote:

> Below SageMath solver run for S=3D{2,3} took less than 5 minutes.
> I tried with S=3D{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?perma=
link_comment_id=3D6027812#gistcomment-6027812
> Then I tried with S=3D{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, [email protected] wrote:
> > On 2026-03-12 16:09, [email protected] wrote:
> >>
> >> The number of solutions to S-Unit equation (u+v=3D1, 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 =E2=84=9A instead of =E2=84=9A(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 =3D=3D 1
> > --------------------
> > -1/8 + 9/8 =3D=3D 1
> > --------------------
> > 1/9 + 8/9 =3D=3D 1
> > --------------------
> > 3 + -2 =3D=3D 1
> > --------------------
> > 4 + -3 =3D=3D 1
> > --------------------
> > 3/4 + 1/4 =3D=3D 1
> > --------------------
> > 1/3 + 2/3 =3D=3D 1
> > --------------------
> > 4/3 + -1/3 =3D=3D 1
> > --------------------
> > -1/2 + 3/2 =3D=3D 1
> > --------------------
> > -8 + 9 =3D=3D 1
> > --------------------
> > 1/2 + 1/2 =3D=3D 1
> > --------------------
> >
> > real  4m45.409s
> > user  4m46.018s
> > sys   0m0.187s
> > hermann@7950x:~$
> >
> >
> > Regards,
> >
> > Hermann.
>
>

--000000000000cfdeb5064cfcbc15
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">I think an efficient S-unit solver would be very useful (=
I=E2=80=99d use it, at least), but it seems like a huge ask.</div><div><br>=
<div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"=
gmail_attr">On Sat, Mar 14, 2026 at 5:48=E2=80=AFAM &lt;<a href=3D"mailto:h=
[email protected]">[email protected]</a>&gt; wrote:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-colo=
r:rgb(204,204,204)">Below SageMath solver run for S=3D{2,3} took less than =
5 minutes.<br>
I tried with S=3D{2,3,5,7} and aborted after 22.5h on AMD 7950X CPU with <b=
r>
boost frequency 5.4GHz run.<br>
<a href=3D"https://gist.github.com/Hermann-SW/b538c991c922b1e8fc06abbab554b=
3ef?permalink_comment_id=3D6027812#gistcomment-6027812" rel=3D"noreferrer" =
target=3D"_blank">https://gist.github.com/Hermann-SW/b538c991c922b1e8fc06ab=
bab554b3ef?permalink_comment_id=3D6027812#gistcomment-6027812</a><br>
Then I tried with S=3D{2,3,5} and aborted after 13.5h.<br>
<br>
Since SageMath S-Unit equation solver is not efficient,<br>
an efficient PARI/GP solution somehow would be desirable:<br>
<a href=3D"https://en.wikipedia.org/wiki/S-unit#S-unit_equation" rel=3D"nor=
eferrer" target=3D"_blank">https://en.wikipedia.org/wiki/S-unit#S-unit_equa=
tion</a><br>
<br>
Regards,<br>
<br>
Hermann.<br>
<br>
On 2026-03-12 21:56, <a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a> wrote:<br>
&gt; On 2026-03-12 16:09, <a href=3D"mailto:[email protected]" tar=
get=3D"_blank">[email protected]</a> wrote:<br>
&gt;&gt; <br>
&gt;&gt; The number of solutions to S-Unit equation (u+v=3D1, u,v S-Units)<=
br>
&gt;&gt; <a href=3D"https://en.wikipedia.org/wiki/S-unit#S-unit_equation" r=
el=3D"noreferrer" target=3D"_blank">https://en.wikipedia.org/wiki/S-unit#S-=
unit_equation</a><br>
&gt;&gt; <br>
&gt;&gt; is finite. That section also says such a solver can be found here,=
 I <br>
&gt;&gt; will try:<br>
&gt;&gt; <a href=3D"https://en.wikipedia.org/wiki/SageMath" rel=3D"noreferr=
er" target=3D"_blank">https://en.wikipedia.org/wiki/SageMath</a><br>
&gt;&gt; <br>
&gt; Never used SageMath before, and it took many iterations with Gemini to=
<br>
&gt; get error free code.<br>
&gt; I changed to use =E2=84=9A instead of =E2=84=9A(i) and added generator=
 output:<br>
&gt; <a href=3D"https://gist.github.com/Hermann-SW/b538c991c922b1e8fc06abba=
b554b3ef" rel=3D"noreferrer" target=3D"_blank">https://gist.github.com/Herm=
ann-SW/b538c991c922b1e8fc06abbab554b3ef</a><br>
&gt; <br>
&gt; hermann@7950x:~$ time Downloads/SageMath-10.8-x86_64.AppImage <br>
&gt; S-Unit.sol.sage<br>
&gt; Generators:<br>
&gt; -1<br>
&gt; 2<br>
&gt; 3<br>
&gt; Found 11 solutions:<br>
&gt; 2 + -1 =3D=3D 1<br>
&gt; --------------------<br>
&gt; -1/8 + 9/8 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 1/9 + 8/9 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 3 + -2 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 4 + -3 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 3/4 + 1/4 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 1/3 + 2/3 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 4/3 + -1/3 =3D=3D 1<br>
&gt; --------------------<br>
&gt; -1/2 + 3/2 =3D=3D 1<br>
&gt; --------------------<br>
&gt; -8 + 9 =3D=3D 1<br>
&gt; --------------------<br>
&gt; 1/2 + 1/2 =3D=3D 1<br>
&gt; --------------------<br>
&gt; <br>
&gt; real=C2=A0 4m45.409s<br>
&gt; user=C2=A0 4m46.018s<br>
&gt; sys=C2=A0 =C2=A00m0.187s<br>
&gt; hermann@7950x:~$<br>
&gt; <br>
&gt; <br>
&gt; Regards,<br>
&gt; <br>
&gt; Hermann.<br>
<br>
</blockquote></div></div>

--000000000000cfdeb5064cfcbc15--