\[p = 217:\ \ \ \]
\[13p - 7p + 24p - 13 =\]
\[= p \cdot (13 - 7 + 24) - 13 =\]
\[= 30p - 13 = 30 \cdot 217 - 13 =\]
\[= 6510 - 13 = 6497.\]