Triskaidekaphobic passcodes
The number 13 is sometimes considered inauspicious in certain cultures and so it is not uncommon for superstitious triskaidekaphobic persons to avoid the use of 13 in their daily life and ask: How many different lucky \(n\)-digit numeric passcodes can be formed such that they do not contain 13 . The special case of \(n = 4\) is actually a problem in the 2019 SPM additional mathematics paper (Paper 1, Question 22). For the uninitiated, this special case of \(n = 4\) can be quite intimidating . Four-digit numeric passcode on a iOS device To get our engine started, let's consider the first trival case when \(n = 1\). Apparently there is no single-digit passcode which contains the pattern 13 or \(\mathbb{S}_{\rm unlucky}^{(1)} = \varnothing\). Thus we do not have any unlucky passcodes when \(n = 1\): $$n(\mathbb{S}^{(1)}_{\rm unlucky}) = 0, \quad n(\mathbb{S}^{(1)}_{\rm lucky}) = 10^1 - n(\mathbb{S}_{\rm unlucky}^{(1)}) = 10$$ where \(n(\mathbb{S}^{...