If the function given by is periodic, prove that p is a rational number.
How do you know that the period of the sum must be a period of both?
Assuming this, of course, the problem is easy; but you should supply proofs of your statements!
See my other thread.