Again, I really just want a nudge in the right direction. Possibly a large nudge, but not the straight forward answer.
I am trying to figure out how to solve Project Euler Problem 191.
I believe I have most of it figured out, but I cannot come up with an algorithm or pattern for the 3-consecutive-Absent days part. I can even find the number of permutations of the strings holding the total number of A-days constant (i.e. how many permutations with only 1 A-day, only 2 A-days, only 3 A-days, etc.), but I cannot figure out how many permutations have 3 consecutive A-days.
So, is there a mathematical formula for this? Is there a way to break this up so that I have "(some # permutations) +/- (another # of permutations) = (# of consecutive A-days)"? I believe this is a combinatorial problem, but maybe it falls under a different category.
Any help is appreciated. Thanks.