Each term has one less m and one more p. So to get the next term, subtract m and add p:
an = an-1 - m + p
Let's see if it works:
a1 = 3m - 2p
a2 = a1 - m + p = 3m - 2p - m + p = 3m - m - 2p + p = 2m - p
a3 = a2 - m + p = 2m - p - m + p = m
a4 = a3 - m + p = m - m + p = p
Yup, it works.