[net.puzzle] Math Puzzle

pizer@ecsvax.UUCP (07/04/84)

A friend of mine introduced me to the following puzzle, I think he called it
fractal geometry.  Whatever it is, it makes an interesting computer problem.
I have found what I believe to be the most efficient method of solving it, but
I like to see what other people come up with, here goes

The problem is to take a number, and determine whether the bit at that
particular position is either 1 or 0.  The position refers to a position in
a string created by taking the string "1001" and then using that as the string,
repeat it using the same pattern, i.e., "1" becomes "1001", "1001" becomes
"1001011001101001", which becomes "10010110011010010110100110010110...".  Given
number 3, for example, the bit would be 0, given 5, it would also be 0, given
7, it would be 1.

If you don't quite understand (I'm not terribly good at explaining things
on paper, or for that matter CRT) or if you have a good solution (mine can
almost be put into one BASIC line) please tell me.

Billy Pizer
(pizer@ecsvax)
{happy 4th o'July}

jmrobson@watdaisy.UUCP (Mike Robson) (07/04/84)

It looks to me as if the bit in position i in these strings is the bit
required to be added to the binary representation of i-1 to give it
odd parity.  An interesting point is that the whole process could have
been started from the string 10 instead of 1001.
				Mike Robson, University of Waterloo (etc.)