MathDB
Dynamic Programming by Hand

Source: 2018 AIME I #14

March 7, 2018
2018 AIME IAMCAIMEAIME I

Problem Statement

Let SP1P2P3EP4P5SP_1P_2P_3EP_4P_5 be a heptagon. A frog starts jumping at vertex SS. From any vertex of the heptagon except EE, the frog may jump to either of the two adjacent vertices. When it reaches vertex EE, the frog stops and stays there. Find the number of distinct sequences of jumps of no more than 1212 jumps that end at EE.