is the following series an alternating series?

Sum n=1, inf, cos(npi)/n^2

can i write it as Sum n=1,inf, ((-1)^(n-1))/n^2, then use the alternating series test, and put it in absoulte value and get 1/n^2 which is a convergent p series? is this correct? thanks