2026-08-17

Problem — 2026-08-17

Medium

MediumCombinatorics

A secret society uses a peculiar handshake code: each member wears 5 distinct rings (one per finger on their right hand), and during a handshake, they interlock some subset of their fingers with their partner. The code works as follows: a handshake is "valid" if and only if no two consecutive fingers are interlocked (e.g., interlocking thumb-index-middle is invalid, but interlocking thumb-middle-pinky is valid). How many distinct valid handshake patterns exist? (Note: interlocking no fingers at all counts as one valid pattern.)

Enter a whole number

Show solution
Let ana_n be the number of valid patterns for nn fingers. We need to find a5a_5. Consider the nn-th finger (rightmost). Either: 1. It is **not interlocked**: Then the first n−1n-1 fingers can form any valid pattern, giving an−1a_{n-1} ways. 2. It **is interlocked**: Then the (n−1)(n-1)-th finger cannot be interlocked (no consecutive), so we have a valid pattern on the first n−2n-2 fingers, giving an−2a_{n-2} ways. This gives the recurrence: an=an−1+an−2a_n = a_{n-1} + a_{n-2} Base cases: - a0=1a_0 = 1 (empty pattern: no fingers interlocked) - a1=2a_1 = 2 (either interlock the single finger or don't) Computing forward: - a2=a1+a0=2+1=3a_2 = a_1 + a_0 = 2 + 1 = 3 - a3=a2+a1=3+2=5a_3 = a_2 + a_1 = 3 + 2 = 5 - a4=a3+a2=5+3=8a_4 = a_3 + a_2 = 5 + 3 = 8 - a5=a4+a3=8+5=13a_5 = a_4 + a_3 = 8 + 5 = 13 Alternatively, we can verify: these are Fibonacci numbers! Specifically, an=Fn+2a_n = F_{n+2} where FkF_k is the kk-th Fibonacci number with F1=F2=1F_1 = F_2 = 1. Therefore, there are **13** distinct valid handshake patterns.