Bill Allombert on Fri, 20 May 2016 15:20:17 +0200

 Re: What am I doing wrong?

• To: pari-users@pari.math.u-bordeaux.fr
• Subject: Re: What am I doing wrong?
• From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
• Date: Fri, 20 May 2016 15:20:09 +0200
• Delivery-date: Fri, 20 May 2016 15:20:17 +0200
• Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
• User-agent: Mutt/1.5.21 (2010-09-15)

```On Fri, May 20, 2016 at 02:28:51PM +0200, Dirk Laurie wrote:
> 2016-05-20 14:21 GMT+02:00 Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>:
> > On Fri, May 20, 2016 at 01:59:14PM +0200, Dirk Laurie wrote:
> >> % qfbsolve(Qfb(1,0,-5),4)
> >> %2 = 0
> >>
> >> Why are the solutions x=3,y=1; x=7,y=3; x=18,y=8; etc not found?
> >
> > Because 4 is not prime:
> >
> > ? ?qfbsolve
> > qfbsolve(Q,p): Return [x,y] so that Q(x,y)=p where Q is a binary
> > quadratic form and p a prime
> > number, or 0 if there is no solution.
>
> Follow-up question: can Pari handle equations like x^2 - 5*y^2 = 4
> directly, or must I write the code exploiting Diophantine approximation
> of sqrt(5) by hand?

This is complicated.
We provide the function bnfisinitnorm that does what you want, with a
caveats: it returns solution in the maximal order Z[(1+sqrt(5))/2]