Challenge: sum of squares. Let's break 299
|
01-19-2018, 04:29 AM
(This post was last modified: 01-19-2018 04:39 AM by Thomas Okken.)
Post: #5
|
|||
|
|||
RE: Challenge: sum of squares. Let's break 299
(01-18-2018 09:32 PM)pier4r Wrote: then in the video they said they tested all the sequences up to 299. From 25 to 299 they found a way and likely there will be always a way. It doesn't say so in so many words, but that made me think that there were no solutions below 25, and that is not the case: n = 15: 8 1 15 10 6 3 13 12 4 5 11 14 2 7 9 n = 16: 8 1 15 10 6 3 13 12 4 5 11 14 2 7 9 16 n = 23: 2 23 13 12 4 21 15 10 6 19 17 8 1 3 22 14 11 5 20 16 9 7 18 I cheated and wrote a simple brute-force backtracking algorithm in C++: Code: #include <stdio.h> In a nutshell: the algorithm would have to be a lot smarter to make a dent in this problem. It starts to get painfully slow in the 60s -- on a 1.3 GHz i5, not a speed demon by today's standards, but still, imagine how this would fare on a calculator. The case n = 60 took 6,619,547,574 iterations... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)