Post Reply 
Quiet Week-end Challenge (49G?) - Closed
05-13-2015, 11:26 AM
Post: #10
RE: Quiet Week-end Challenge (49G?)
(05-09-2015 10:50 AM)Gerald H Wrote:  Challenge is to write a programme that produces a list of four even integers & a list of four odd integers which, on respectively squaring & summing the elements give the same total.

eg

{ 34388 8306 13454 23910 }

&

{ 18269 40029 2665 7813 }.

The programme should be able to produce at least 5,789,854 different pairs of lists.

I'm part of the way there, I think.

My program looks only at lists whose elements are in the range [0, 200) and finds 935 614 406 different pairs from [[1, 1, 1, 1], [0, 0, 0, 2]] to [[197, 197, 197, 199], [196, 198, 198, 198]] with 17 467 different sums of squares.

It's not very interesting that the elements are such small integers, but I suppose I could "fix" that by seeding using consecutive primes instead of consecutive integers, or by generating additional pairs using Euler's four-square identity.

The glaring deficiency is that this isn't running on a calculator but on my ancient laptop. However, as the stated problem is to find only 5 789 854 different pairs of lists, I'm optimistic that the calculator might be fast enough to run a stripped down version without taking too many hours to complete.

The main problems with porting this solution to the calculator are shortage of memory and storage. During the running of my solution I have as many as 27 749 sums of squares and as many as 6 708 871 4-element lists in memory at once and my output file is approximately 176 MB. Of course these numbers would be considerably smaller if I'm only trying to produce 5 789 854 different pairs of lists, and there's scope for some optimisation.

The other problem is that I've rarely programmed a calculator since I had my old HP-28S! The main blockers so far is that looking in the AUR I can't find the following information for the 50g:

1. The size of an integer object.
2. The size-overhead of a list beyond it's contents.
3. The maximum allowed size of a list object.
4. The maximum allowed size of a string object.
5. How to write a text file to SD card. (Just save a string object to Port 3?)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Quiet Week-end Challenge (49G?) - nlj - 05-13-2015 11:26 AM



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