HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares
|
04-14-2018, 05:10 PM
(This post was last modified: 04-14-2018 05:39 PM by Thomas Ritschel.)
Post: #3
|
|||
|
|||
RE: HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares
I have a solution based on Joe Horn's \Gs (sum of divisors) routine:
Code:
Code: %%HP: T(3)A(R)F(.); For 720^20 it computed the result 42050501860687733694307540234728644161563553655537254442648 in less than 2 seconds (Edit: actually 0.8 sec). However, it has a flaw: It doesn't work for the inputs 1 and 4 (\Gs fails if n==1). Open for improvements... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)