hermann on Tue, 03 Oct 2023 09:31:25 +0200


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

Re: How to generate wolframscript "PowersRepresentations[...]" output in PARI/GP


On 2023-10-02 20:54, Bill Allombert wrote:

If you want only one solution, you can do

foursquare(n) = abs(qfsolve(matdiagonal([1,1,1,1,-n]))[1..4]);

? foursquare(17*29)
%15 = [0,0,13,18]~

? foursquare(2^127-1)
%13 =
[3485713606461563310,6176908041673972933,4510469025815889567,9974590734764851407]~

Thank you, that is fast and cool.

I tried qfsolve() on bigger numbers, and asked myself whether pari lib
and C could speed up computation.

I looked at the 37 hits for "solve" in manual:
https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.15.4/libpari.pdf

I found qfbsolve() and cornacchia(), but nothing I could match to GP qfsolve().
Is qfsolve() only available for GP?


Regards,

Hermann.