As noted in the comments, you can replace $(a,b)$ by (a',b') = (a-n, b-n) and your condition then becomes a'b' | n(a'+b'+n-1). I will make the replacement, and drop the primes.
$ab|n(a+b+n-1)$ implies $ab \leq n(a+b+n-1)$ and $b|n(a+n-1)$. Assume WLOG $b \geq a$ then $a \leq n(a/b + 1) + n(n-1)/b < n^2+n$, and $b < n^3 + 2n^2$.
But you only have to run the loop over $a$, you then use the fact that $b|n(a+n-1)$, factorize $n(a+n-1)$, and find all divisors $b$ in the range $[a,...k-n]$. Then for such pairs $(a,b)$ you check that they satisfy the condition $ab | n(a+b+n-1)$.
You can actually do better on the bounds of the a loop using the fact that $n(n−1)/b≤n(n−1)/a$, so $a≤2n+n(n−1)/a$. That is equivalent to $(a−n)^2≤2n^2−n$, so your loop is actually of size O(n).
Running the second loop from $[a,...,k-n]$ isn't wrong, it just takes too long. As to the implementation: 1) Generate a list of primes from 1 to $\sqrt{n}$. 2) Do trial division from this list of primes into n to get the factorization of n. 3) Create an array A of size $(1+\sqrt{2})n$. Each entry in the array should be a list of (prime, power) such that if this is in the $k$th entry of the array, $(n+k)$ is divisble by (prime) raised to (power). 4) You fill in this array by going thru the list of primes, finding the smallest number >= n that is divisible by prime^power, and incrementing by prime^power. 5) Now that you have the factorizations of n and all numbers in the range $[n,...,(2+\sqrt{2})n]$, you go thru and find divisors of $n*(n+k)$ that are greater than $k \space (= a-1)$. For each such divisor $b$, you check that $ab | n(a+b+n-1)$.