Find $C$ such that $x^2 - 47x - C = 0$ has integer roots, and further conditions
Solution 1:
The quadratic formula implies that this is equivalent to getting $47^2+4C$ to be the square of an odd integer.
$$47^2-(2n+1)^2=-4C\\ 4(23-n)(24+n)=-4C\\ (n-23)(n+24)=C$$
So we need to find $n$ such that $(n-23)(n+24)$ is a multiple of $30$ with no prime factors other than $2,3,5$ and $47^2+4(n-23)(n+24)\geq 0$.
Inspection reveals $n=3$ as a solution with $C=-20\cdot 27=-2^23^35=-540$. Then $47^2+4C=49$ and the quadratic formula gives roots $$\frac{47+7}{2}=27\text{ and }\frac{47-7}{2}=20$$ to the equation $$x^2-47x+540=0$$
Edit:
This was "too long for a comment."
I speculate that the method I give above can be pushed a little further to get which values of $n$ work, hence giving an integral parametrization of the solutions ($C$) of the problem.
The same approach can be applied to $x^2-397x-C=0$ with $2,3,5,7,11,13,17,19$ as prime factors. You are right that "inspection" only gets so far. I don't want to spend the time on the case you put in your comment, but my initial approach would be use the method above to get a parametrization of $C$ in terms of $n$, use congruences and the chinese remainder theorem to restrict the possible values of $n$, and to write a short algorithm finding the first few $n$ that work.
Solution 2:
Say $$ x^2 -47x - c = (x-a)(x-b) $$ for integers $a$ and $b$. Then $$ a + b = 47 \\ -ab = C. $$ So $a$ and $b$ must have only $2,3,5$ in their prime factorization.
Say $b$ is divisible by $5$ (one of them must be). So say $b = 5n$. So then $47 - a$ is divisible by $5$. And $a$ must be $-13 , -8 , -3 , 2, 7, 12, 17, \dots$. So $a = 2 + 5m$. Pick out those that are divisible by only $2$ or $3$.
By trial and error $$ a = -3, b = 50 $$ would work. Another solution is $$ a = 72, b = - 25. $$ Note, for example that $a=12$ would give $b = 35$, but then $b$ is divisible by $7$.
Solution 3:
$$C=150=2\cdot3\cdot5^2\implies x\in\{-3,50\}$$ $$C=-90=-2\cdot3^2\cdot5\implies x\in\{2,45\}$$ $$C=-480=-2^5\cdot3\cdot5\implies x\in\{15,32\}$$ $$C=-540=-2^2\cdot3\cdot5^2\implies x\in\{20,27\}$$