What is the sum of all positive integers n such that \operatorname{lcm}\left(2 n, n^{2}\right)=14 n-24?