Challenge: sum of squares. Let's break 299
|
01-25-2018, 02:04 AM
(This post was last modified: 01-25-2018 02:12 AM by Allen.)
Post: #40
|
|||
|
|||
RE: Challenge: sum of squares. Let's break 299
Given the way it decimates and limits options, there is trade off between speed and accuracy. The settings that will guarantee a solution for small N are very slow for large N, but i have not had to run the same test case more than a few times to "tweak" the decimation to get it through the bottlenecks.
(NOTE: The code below was used to solve N=1000, and may decimate too aggressively for smaller N.. adjust as necessary, or come up with a clever way to auto-adjust ) No doubt some one else here can make a clever hack and speed this up ten fold. You'll see in the solutions above that it tends to satisfy all the higher square values (with the most constraints) first then move on to smaller and smaller numbers. My challenge to the group would be to have a program that can calculate N=1000 in just a few seconds. My only request is that if this is mapped to a more general solution ( and I think one exists), cite my work here or wherever it lands. Deal? Here is the whole code. No fancy imports or packages.. just straight python 2.7* Code:
17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)