A brilliant binary sequence is a sequence of digits made of 0's and 1's such that each digit is adjacent to at least one 1.
Let be the number of brilliant binary sequences of length . A positive integer is called batty if is divisible by 20. Find the smallest that is batty .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Relevant wiki: Linear Recurrence Relations - Problem Solving
The number of sequences of length k that can be put together out the single digit 1 and the digit pair 1 0 is equal to the ( k + 1 ) st Fibonacci number F k + 1 (defined with F 0 = 0 , F 1 = 1 , F 2 = 1 , ...). This is a pretty standard result.
It is clear that S 2 = 1 and that S 3 = 3 . Suppose now that k ≥ 2 .
In a Brilliant binary sequence of length 2 k , the subsequence of the 2 nd, 4 th, 6 th, ..., ( 2 k ) th digits cannot contain repeating 0 s, and the second digit must be 1 . The number of such subsequences is the the number of sequences of length k that can be put together out of the single digit 1 and the digit pair 1 0 , namely F k + 1 . Similarly, the subsequence of the 1 st, 3 rd, 5 th, ..., ( 2 k − 1 ) st digits cannot contain repeating 0 s, and the ( 2 k − 1 ) st digit must be 1 . There are F k + 1 such subsequences. Thus we deduce that S 2 k = F k + 1 2 .
In a Brilliant sequence of length 2 k + 1 , the subsequence of the 1 st, 3 rd, 5 th, ..., ( 2 k + 1 ) st digits cannot contain repeated 0 s, and is of length k + 1 . But this is the number of sequences of length k + 2 that can be put together out of the single digit 1 and the digit pair 1 0 (just add a 1 to the start to see why), and so there are F k + 3 such subsequences. Similarly, the subsequence of the 2 nd, 4 th, 6 th, ..., ( 2 k ) th digits cannot contain repeating 0 s, and the second and ( 2 k ) th digits must both be 1 . This is just the collection of sequences of length k − 1 that can be put together from the single digit 1 and the digit pair 1 0 , with an extra digit 1 added to the end. Thus there are F k such sequences. Thus we deduce that S 2 k + 1 = F k + 3 F k .
Since S 2 k = F k + 1 2 S 2 k + 1 = F k + 3 F k k ≥ 2 , it merely remains to find the smallest value of k for which S k is divisible by 2 0 . This happens with S 2 5 = 8 7 8 4 0 , and so the answer is 2 5 . The next batty number is S 2 8 = 3 7 2 1 0 0 .
We could note that F k ≡ 0 ( m o d 2 ) provided that k ≡ 0 ( m o d 3 ) , and that F k ≡ 0 ( m o d 5 ) provided that k ≡ 0 ( m o d 5 ) . From these observations and the Chinese Remainder Theorem we can deduce that S k ≡ 0 ( m o d 2 0 ) provided that k ≥ 2 and k ≡ 1 , 2 5 , 2 8 ( m o d 3 0 ) . The batty numbers are those k ≥ 2 which are congruent to one of 1 , 2 5 or 2 8 modulo 3 0 .