We know that any an term of an AP is given by an=a+(n−1)d
According to the question,
5a5=8a8
⇒5(a+4d)=8(a+7d)
⇒5a+20d=8a+56d
⇒3a+36d=0
⇒3(a+12d)=0
∴a13=0