• Subject: Re: Help with an algorithm
• From: Vaughan McAlley <vaughan@...>
• Date: Sun, 26 May 2013 16:42:41 +1000

On 26 May 2013 01:33, Steve Litt <slitt@troubleshooters.com> wrote:
>> On 25 May 2013 01:28, Steve Litt <slitt@troubleshooters.com> wrote:

> Vaughan,
>
> Where in the program did you tell it you're using 40 bit numbers? Or
> did you just quit when you reached
>
> 0000000000000000000000000000000000000001111111111111110000000000000000000000000
>
> ?
>

Yes, I just checked that the number was over 2^40.

> Did you find any evidence of your computer CPU overheating?

No, my 2008 iMac coped fine. It got a bit warm, but not as warm as an equivalent time playing Starcraft would (not that I have that kind of time to spare these days). It’s nearly winter here in Australia.

>
> What properties made some of these numbers more interesting than
> others? Did you use pipes like:
>
> ./find_fifteens | ./show_interesting.sh > interesting_numbers.txt
>

I’m laying an area of pavers 8 wide by 5 down, with dark and light pavers available. I wanted to do an ‘interesting’ pattern... being fond of the golden ratio and noticing 8 & 5 are Fibbonaccci numbers, I thought I could encode a 40-bit number that when read from the (right) side, is the golden ratio away from when it is read from the bottom.

So what I have found is:

+---------- <- back fence
| 01110111
| 01000100
| 00101000
| 10100000
| 10100010

is 0x774428a0a2... when read looking from the right you get:

11000 00011 11101 00001 00100 00011 10001 00001

or 0xc0fa120e21

print(0xc0fa120e21 / 0x774428a0a2) gives you the golden ratio to 11 decimal places, which is the most interesting to me :-)

You’ll notice I’m using a Hamming weight of 15 instead of 25. Either way was fine if the ones and zeros relate by roughly the golden mean.

> ./find_fifteens | ./show_interesting.sh > interesting_numbers.txt
> These are the times I love computers. I might do this myself.
>
No, I just printed out the best result as it appeared. But you are correct... computers can be a lot of fun :)

> Thanks,
>
> SteveT
>

Cheers,
Vaughan