Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It's a special case, but the pari function qfbsolve(Q,p) solves Q(x,y)=p where Q is a binary quadratic form and p a prime. It would be easy to wrap that function in sage/libs/pari/gp.pyx. For now:

sage: Q = gp.Qfb(1,0,1)
sage: Q
Qfb(1, 0, 1)
sage: Q.qfbsolve(97)
[9, 4]