hermann on Thu, 12 Mar 2026 15:36:51 +0100


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

Re: S-Unit questions


On 2026-03-12 15:10, Bill Allombert wrote:
On Thu, Mar 12, 2026 at 02:58:16PM +0100, hermann@stamm-wilbrandt.de wrote:
On error message it explained that linear polynomial has too low degree for
thueinit.
And to use a script with "bnfisunit()" — but current GP does not know this
command.

bnfisunit certainly exist, though it will probably not help you...

? ?bnfisunit()
bnfisunit(bnf,x,{U}): bnf being output by bnfinit, give the column
vector of exponents of x on the fundamental units and the roots of
unity if x is a unit, the empty vector otherwise. If U is present, as
given by bnfunits, decompose x on the attached S-units generators.

Sorry, I coorected that in my 2nd email.

So how to solve this equation using PARI/GP with its Baker(?) algorithm?

±2^{a1}*3^{b1}±2^{a2}*3^{b2}=1

I do not think there is a GP function that can solve this, though this
is solvable
in principle using linear forms in logarithms.

Cheers,
Bill.

This is the script proposed by Gemini, which errors on bnfuniteqn() not existing:

? {
  \\ 1. Initialize Q
  bnf = bnfinit(x - 1);

  \\ 2. Define S = {2, 3} correctly
  S = concat([idealprimedec(bnf, 2), idealprimedec(bnf, 3)]);

\\ 3. Get the S-unit structure AND the map (the '1' at the end is vital)
  s_struct = bnfsunit(bnf, S);

  \\ 4. Solve the S-unit equation epsilon_1 + epsilon_2 = 1
\\ This returns the solutions as exponent vectors relative to the S-unit generators
  solutions_vecs = bnfuniteqn(s_struct);

  \\ 5. Convert exponent vectors back into actual rational numbers
  \\ s_struct[1] contains the generators: [-1, 2, 3]
  gens = s_struct[1];

  print("Solutions (x, y) where x + y = 1:");
  for(i = 1, #solutions_vecs,
      sol = solutions_vecs[i];
      \\ The solution is a pair [x, y]
      x = nfeltfactorback(bnf, gens, sol[1]);
      y = nfeltfactorback(bnf, gens, sol[2]);
      print([x, y]);
  );
}
  ***   at top-level: ...it(bnf,S);solutions_vecs=bnfuniteqn(s_struct);
  ***                                             ^---------------------
  ***   not a function in function call
  ***   Break loop: type 'break' to go back to GP prompt
break>


Regards,

Hermann.