Let $m$ be the smallest positive integer such that Coefficients of $x^2$ in the expansion
$\displaystyle (1+x)^2+(1+x)^3+.....+(1+x)^{49}+(1+mx)^{50}$ is $\displaystyle (3n+1)\binom{51}{3}$
for some positive integer $n\;,$ Then $n=$
$\bf{My\; Try::}$ Let $$S=\underbrace{(1+x)^2+(1+x)^3+........(1+x)^{49}}_{=\frac{(1+x)^{50}-(1+x)^2}{x}}+(1+mx)^{50}$$
So Coefficient of $x^2$ in $$S=\displaystyle \frac{(1+x)^{50}-(1+x)^2+x(1+mx)^{50}}{x}$$
So So Coefficient of $x^3$ in $$S=\displaystyle(1+x)^{50}-(1+x)^2+x(1+mx)^{50}$$
And which is equal to $$=\binom{50}{3}+m^2\binom{50}{3} = \binom{50}{3}(1+m^2) = (3n+1)\binom{51}{3}$$
So after simplification, We get $$16(1+m^2)=17(3n+1)\Rightarrow 16m^2-51n=1$$
Now How can I calculate $n$ after that, Help required, Thanks