<s>[INST] One number is removed from the set of integers from $1$ to $n.$ The average of the remaining numbers is $163/4.$ Which integer was removed? 
One number is removed from the set of integers from $1$ to $n.$ The average of the remaining numbers is $\dfrac{163}4$.  Which integer was removed?

Source. British Mathematical Olympiad 2010/11, Round 1, Problem 1
I was hoping if someone could spot the flaw in my working for this question.
Attempt.
I began by letting the integer that was removed be $x$.
Then: $$\frac{1 + 2 + \cdots + (x-1) + (x+1) +\cdots + n} {n-1} = \frac{163}{4}$$
There is two arithmetic sums in the denominator, the first from 1 to $x$ and the second from $x+1$ to $n$.
These are equal to $\frac{x(x-1)}{2}$ and $\frac{(n-x)(n+x+1)}{2}$, and subbing in to first equation this gives:
$$\frac{x(x-1) + (n-x)(n+x+1)}{2(n-1)} = \frac{163}{4}$$
which reduces to:
$$\frac{n^2 + n - 2x}{2(n-1)} = \frac {163}{4}$$
And then:
$$2(n^2 + n -2x) = 163(n-1)$$
At first I thought you could consider factors, as 163 was prime then:
$n-1 = 2$ giving $n = 3$ and $n^2 + n - 2x = 163$, which using $n=3$ gives $x= -75.5$ which isn't our positive integer.
I then tried considering a quadratic in $n$ and using the discriminant but again that just looked to give a negative value of $x.$ I would be grateful for any help
 [/INST] This is not how you are supposed to solve it, but I feel like cheating. We have the equation $2(n^2+n-2x)=163(n-1)$, and $1\leq x\leq n$.
If you assume that $x=1$ then you solve for $n$ using the quadratic formula, and you obtain $79.5$.
If you assume that $x=n$ then you solve for $n$ you obtain $81.5$. Thus $n=80$ or $n=81$.
If $n=80$ then you can solve for $x$ and obtain $83=4x$, wrong. So $n=81$. Solving again yields $4n=244$, and ding ding, we have a winner.

As everyone else seems to have done this in the way I considered cheating, I should expand on the way I initially did it, which is completely different.
We have $2(n^2+n-2x)=163(n-1)$, and $1\leq x\leq n$. We see that $n$ is odd, so $n=2m+1$. Substituting in and cancelling the 2s yields
$$(2m+1)^2+(2m+1)-2x=163m$$
or
$$4m^2+2-2x=157m.$$
Write $y=x-1$ and also, the LHS is even, so $m=2a$ is even. More substituting  and removing the $2$ from both sides yields
$$8a^2-y=157a.$$
The crucial point: we see that $a\mid y$. Since $n=2m+1=4a+1$, and $y$ is a multiple of $a$, $y=\alpha a$ for $\alpha$ between $1$ and $4$. Dividing through by $a$ yields
$$8a-\alpha=157.$$
Taking congruences modulo $8$ yields $\alpha\equiv 3\bmod 8$, so $\alpha=3$. Thus $y=3a$, so $x=3a+1$ and $n=4a+1$. We put this back into the top equation, $2(n^2+n-2x)=163(n-1)$, to obtain $a=20$, so $n=81$, $x=61$.
</s>