Find all pairs (n,p)(n,p) of positive integers such that pp is prime and

1+2++n=3(12+22++p2).1 + 2 + \cdots + n = 3 \cdot (1^2 + 2^2 + \cdots + p^2).