Find the largest value $n$ $(n \ge 0)$ and for that that $n$ find $a$ and $d$ in the following equation (also $a$ and $d$ are positive integers): $$4020=(2a+nd+1)n$$

My attempt:

$1.$ Factor $4020$ as $ 4\times 3 \times 5 \times 67$ and then do grouping but then it is a very lengthy method.

$2.$ Use any software. But leave this attempt at this moment.

Any help will be greatly appreciated.


We know that $n$ must be a prime factor or product of the prime factors $(3, 4, 5, 67)$. Clearly if $a$ and $d$ are positive integers $2a+nd+1>n$. So if $n$ is divisible by $67$ then $(2a+nd+1)n > 67^2 >4020$ hence $n$ must be at most $3\times4\times5$. We see that by setting $n=60, a=3, d=1$ we have a solution, so $n=60$ is the maximum $n$