Jim
“A row of 0s & 1s repeats in blocks of 4, another below it repeats in blocks of 5. Count how many 0s line up over 20 terms. What notice?”
Curious question: what could we be looking for, or hoping to notice?
We could, of course, try all rows of 0’s and 1’s of length 4, together with all
rows of 0’s and 1’s of length 5 – giving us
possibilities – and check in each case the times the 0’s line up. And maybe we should do just that.
For now let’s just generate a random example and see what we might notice.
Here’s some Mathematica code to construct a random example:
A = Table[RandomInteger[{0, 1}], 4]
AA = Flatten[Table[A, 5]]
B = Table[RandomInteger[{0, 1}], 5]
BB = Flatten[Table[B, 4]]
Apositions = Flatten[Position[AA, 0]]
Bpositions = Flatten[Position[BB, 0]]
common=Intersection[Apositions, Bpositions];
Print[“There are “,Length[common], ” positions where the 0’s line up”]
and running this once gave the following:
{0, 0, 0, 1}
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}
{1, 0, 0, 0, 0}
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0}
{1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19}
{2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, 20}
There are 12 positions where the 0’s line up
Nothing pops out, at least not to me.
Doing this a few more times doesn’t indicate any pattern of the number of times 0’s line up.
So let’s do this a bunch of times, say 1,000,000 times.
What numbers of line ups do we get?
Here’s some Mathematica code to do that:
n = 1;
L = {};
While[n <= 1000000,
A = Table[RandomInteger[{0, 1}], 4];
AA = Flatten[Table[A, 5]];
B = Table[RandomInteger[{0, 1}], 5];
BB = Flatten[Table[B, 4]];
AAA = Flatten[Position[AA, 0]];
BBB = Flatten[Position[BB, 0]];
L = {L, Length[Intersection[AAA, BBB]]}; n++]
L = Union[Flatten[L]]
and here’s the result:
{0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 20}
The numbers that are missing from this list are 7, 11, 13, 14, 17, 18, 19
Curiously, this number sequence – 7, 11, 13, 14, 17, 18, 19 – occurs in the Online Encyclopedia of Integer Sequences as part of a larger sequence: namely the ordered sequence of nonnegative differences f-4g, where f and g are Lucas numbers.
Is the sequence 7, 11, 13, 14, 17, 18, 19 exactly the list of forbidden number of times the 0’s line up: we can check this by examining all possible sequences of 0’1 and 1’s of length 4 and 5.
Why is there a connection with Lucas numbers? Is this a coincidence, or is there a story here?