Let triangle A1BC have sides A1B=5, A1C=12, and BC=13. For all natural numbers i, let Bi be the foot of the altitude from Ai to BC, let A2i be the foot of the altitude from Bi to A1B, and let A2i+1 be the foot of the altitude from Bi to A1C.
i=1∑7AiBi=qp
Find p+q.2022 CCA Math Bonanza Individual Round #13