For the given problem, (a,p) = (1,1) is the only positive integer pair satisfying conditions of the problem.
If non negative p were permissible in terms of the given conditions, then we would have obtained (a,p) = (1,0) as an additional solution.
Edited on February 26, 2008, 12:23 pm