the number of multiples of 10 between 10p and 10p^3 (inclusive of 10p and 10p^3) is

Answer is p^3-p+1

I need help with the steps!!!

Treat it like a AP, with the first term

a = 10p and the common difference as 10 and last term is 10p^3
so we want term(n) = 10p^3

term(n) = a + (n-1)d
10p + (n-1)(10) = 10p^3
divide each term by 10
p + n-1 = p^3
n = p^3 - p + 1