For each p > 1, a sequence {An} is defined by
A0 = 1 and An = pn + (–1)n An – 1 for each n ≥1. For
how many integer values of p, 1000 is a term of
the sequence?