m is either even or zero (when divided by two it is an integer)

as p is a prime number, (n[tex]\mp[/tex]1) must be dividable by two, so n is odd

This is as far as I can reason... I probably calculated unnecessary information.

The site I got this problem from seems to have neglected to add a solution, so I can't check for answers. I'm curious what you think is the easiest way to solve this.

Well, there are not so many primes p between 2 and 51, in order to test if p^2+1776p is a square.
Actually, only one of them will work. ;)

I have one objection to the logic above: you go from a sum of the form (a+b)/2 and distribute the division into a/2+b/2, but then you cannot make statements about the individual parity of a or b. If (a+b) is even, then a and b have the same parity, either both odd or both even, but nothing else can be said about that (unless you know the actual parity of one of them, which is not the case).

I see the intuition beyond splitting q into np+m, but I believe that what you'd like is to split p into 10n+m, with m in [1,10], since then n would directly tell you in which category A,B,C,D,E the prime p lies in. I tried to substitute this in the quadratic solution, but didn't get anywhere and recurred to brute force. :)

Oh, wait. Correct me if I'm wrong. I would have written the factorization as (x-rp)(x-sp)... and after checking, I see r+s = -1, which matches. (The solution for x starts with minus p/2, plus/minus the square root of blah blah / 2)

The easiest way is certainly easier. It is apparent that the discriminant p^2 + 1776p must be a perfect square. Since p divides into the discriminant, so must p^2. Hence p divides into 1776. The primes of 1776 are 2, 3 and 37.

I'm not sure how this is easier... I think this is pretty much the same as what we've done except that it does not show which one is p. Note that the method summarized by mr vodka also predicts whether or not this will happen... the x^0 must be a product of only three numbers: p and two numbers that differ by exactly one.