Skip to main content
1 of 4
Max Alekseyev
  • 34.3k
  • 5
  • 74
  • 152

Values for $a$ and $b$ as polynomials in $x,y$, when they exist, correspond to factorization of $\frac{x^p+y^2}{x+y}$ over the imaginary field $K_p:=\mathbb Q[\sqrt{-p}]$ of the form $$\frac{x^p+y^2}{x+y} = (a(x,y)+\sqrt{-p}b(x,y))\cdot (a(x,y)-\sqrt{-p}b(x,y)).$$ This Sage code performs factorization of $\frac{x^p+1}{x+1}$ over $K_p$ and test if the result has the required form, in which case the (univariate) polynomials $a(x,1)$ and $b(x,1)$ are reported. As an example, it reports $a$ and $b$ for all primes below $100$. Each prime $\equiv 3\pmod4$ in that range happens to have a solution.

Max Alekseyev
  • 34.3k
  • 5
  • 74
  • 152