Post Reply 
HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares
04-20-2018, 07:35 AM
Post: #28
RE: HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares
Of course, since Pari is a fully fledged programming language, one could write his own advanced factoring method.

One nice example is William B. Hart's ONE LINE FACTORING ALGORITHM:

Code:
OLF(x)=;i=1;while(i<x,if(issquare(ceil(sqrt(i*x))^2%x),return(gcd(x,floor(ceil(sqrt(i*x))-sqrt((ceil(sqrt(i*x))^2)%x)))));i++)

\p42   /* set precision to 42 digits */
q=(720^20+19)*(720^20-19)
OLF(q)

This instantly yields 1401683395356260729391818575873415577599999999999999999981, the lower of the two factors (720^20-19).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares - Thomas Ritschel - 04-20-2018 07:35 AM



User(s) browsing this thread: 1 Guest(s)