in reply to Explain one liner for fibonacci
Now, because (1|11\1) eats either 1 or 2 characters, and then tries the trick on the rest of the pattern, the number of ways a string of length n can fail is:
which is the formula for Fibonacci numbers.F(n) = F(n-1) + F(n-2)
Also note that $==1 just means $= = 1.
|
---|