Aurel Page on Thu, 12 Mar 2026 15:41:09 +0100


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

Re: S-Unit questions


On 3/12/26 15:36, hermann@stamm-wilbrandt.de wrote:
So how to solve this equation using PARI/GP with its Baker(?) algorithm?

±2^{a1}*3^{b1}±2^{a2}*3^{b2}=1
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>
This solution is a hallucination: we do not currently have an S-unit equation solver in PARI, though it would be interesting to have one.

Cheers,
Aurel