For $N,a,b \in \mathbb{Z}$ and distinct $a,b>1$, how can I determine if it is possible to factor $N$ as any $a \times b \times (a+b)$? (I don't necessarily need all $a,b$ if that helps...)
My first thought was to factor $N$, then enumerate the factors into three buckets, $a$, $b$, and \$leftover, then check if \$leftover equals $a+b$. But this grows quite badly, for n total factors ~ $\mathcal{O}(n!)$ (OEIS A200978), so this approach seems infeasible.
If you fix the value of $a$, you have a simple quadratic equation $b(b+a) = \tfrac{N}{a}$ with $b$ the unknown, you can solve it to get two possible values, then you check if any of those are natural numbers and divisors of $N$. So to find out if such $a$ and $b$ exist, you need to check all values of $a$ which are divisors of $N$, and for every such $a$ find $b$.
For a number with $k$ divisors this algorithm's complexity is $O(k) + O(factorize(N))$ where $factorize(N)$ is complexity of factorizing a number.