hermann on Wed, 28 Feb 2024 10:01:12 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: foursquares.gp |
On 2023-11-19 00:28, hermann@stamm-wilbrandt.de wrote:
Bill did develop and tuned foursquares.gp based on this thread: https://pari.math.u-bordeaux.fr/archives/pari-users-2310/msg00003.html You can find foursquares.gp in contributed GP scripts section: https://pari.math.u-bordeaux.fr/Scripts/ https://pari.math.u-bordeaux.fr/Scripts/foursquares.gp
Just saw (interesting) discussion "Fermat's 12th composite part as sum of two squares" in "mersenneforum.org->Fun Stuff->Puzzles": https://mersenneforum.org/showthread.php?t=29344F_12 (2^2^12+1) has 6 known factors, and the composite part has 1133 decimal digits. Alpertron used his calculator to provide one sum of two squares representation.
I cloned his repo, and that computation took less than 0.1s.I tried to make it compute another sum of two squares [for factoring the composite part ;-)]. But fsquares returned sum of three squares next, again in less than a second.
So the code for determining sum of (up to 4) squares was perhaps just lucky to find two squares:
https://mersenneforum.org/showthread.php?p=651405#post651405I did run PARI/GP twosquares() on composite part and aborted after 81min on AMD 7950X CPU.
foursquares(n) returns result in 136ms, threesquares(n) in 259ms for composite n.
Regards, Hermann.