Yes, the only way to factor a prime number is 1 times itself. So if , you must have a- b= 1 and a+ b= p. Adding those two equations, 2a= p+1 so a= (p+1)/2. Subtracting them, 2b= p- 1 so b= (p-1)/2. Of course, because the condition is that p be anoddprime number, both p+1 and p-1 are even and so a and b are integers- that's the only thing you were missing.