For how many rational $x$ is $P(x)$ such that $54x^n+P(x)=315$? 
Given an integer $n >2$,for how many different rational numbers $x$
  does there exist a polynomial $P(x)$ of degree $n-1$ with $P(0)=0$,and
  with all integer coefficients,such that $54x^n+P(x)=315$ ?

My effort
From $P(0)$ I must have that $P(x)$ is a polynomial without constant term ,i.e $$P(x)=a_{n-1}x^{n-1}+\cdots+a_1x+a_0$$ where $a_0=0$
But now I am quite stuck about what to do next ...I would like to have some hint
My idea is to let $G(x)=P(x)-315+54x^n=a_n(x-r)(x-d)\cdots$ and analyze this polynomial.
 A: Let $\frac ab$ with $\gcd(a,b)=1$ be a rational such that it satisfies $$54\left(\frac{a}{b}\right)^n+P\left(\frac{a}{b}\right)=315$$ so that $$54a^n+b^nP\left(\frac{a}{b}\right)=315b^n$$
We know that $b^nP\left(\frac{a}{b}\right)$ is an integer, and since $P(0)=0$, the constant term is $0$, so it is not hard to see that both $a$ and $b$ divide $b^nP\left(\frac{a}{b}\right)$ (this argument is true because $\deg(P)\leq n-1$). Thus, since $\gcd(a,b)=1$, $a|315$ and $b|54$. Now we are left with counting the possibilities for $a$ and $b$, which I'm sure you're capable of.

To complete this answer, I'll include the the counting the possibilities for $a$ and $b$. Notice that $\gcd(54,315)=9$ (remember: $\gcd(a,b)=1$), and so we'll need to split cases. Case 1:  $b$ doesn't have a factor $3$. We have $\sigma_0(2)=2$ possibilities for $b$ (where $\sigma_0$ is the divisor counting function) and $\sigma_0(315)=12$ possibilities for $a$ (total $2\cdot 12=24$ possibilities). Case 2: if $3|b$, then we have $\sigma_0(54)-\sigma_0(2)=6$ possibilities for $b$, and $\sigma_0(35)$ for $a$ (total $6\cdot 4=24$), so that makes $48$ possibilities.
