$2(t-n)=j+n$ , $n(j-2)=t+2$ ,find the sum of all possible values of $n$ where $t$ and $j$ are positive integers

contest-mathnumber theoryproblem solving

Let $n$ be a positive integer. Each of Tom and Jerry has some coins. If Tom gives
$n$ coins to Jerry, then Jerry will have 2 times as many coins as Tom. If instead
Jerry gives 2 coins to Tom, then Tom will have $n$ times as many coins as Jerry.
Find the sum of all possible values of $n$.

I simplified the question to 2 equations where $t$ is Tom's initial sum of coins and $j$ is jerry's initial sum and $t,n,j$ are positive integers.

$2(t-n)=j+n$

$n(j-2)=t+2$

I managed to get $3(t+1)=(j+1)(n+1)$ from those 2 equations
but I don't know what to do next hints, suggestions and solutions would all be appreciated

taken from the 2016 TIMC https://chiuchang.org/wp-content/uploads/sites/2/2018/01/2016_TIMC_Keystage_III_Individual_Final.x17381.pdf

Best Answer

Sumplyfing, I have: $t=nj-2n-2$. Substituing in the first and doing some calculation, I obtain: $$j=\frac{7n+4}{2n-1}$$ And so: $$\frac{n+7}{2n-1}+3$$The denominator have to be less then the numerator, so : $|2n-1|\leq |n+7|$ and $-2\leq n \leq 8$. In this range the only solutions for which $j$ is an integer are: $n=1$, $n=2$, $n=3$ and $n=8$. The sum of all possible value of $n$ is $14$.