22. N3 (BUL) ${ }^{\mathrm{IMO} 2}$ Determine all pairs $(a, b)$ of positive integers such that  
$$ \frac{a^{2}}{2 a b^{2}-b^{3}+1} $$  
is a positive integer.
22. Let \(a\) and \(b\) be positive integers for which \(\frac{a^{2}}{2 a b^{2}-b^{3}+1}=k\) is a positive integer. Since \(k>0\), it follows that \(2 a b^{2} \geq b^{3}\), so \(2 a \geq b\). If \(2 a > b\), then from \(2 a b^{2}-b^{3}+1>0\) we see that \(a^{2}>b^{2}(2 a-b)+1>b^{2}\), i.e., \(a > b\). Therefore, if \(a \leq b\), then \(a = b / 2\). We can rewrite the given equation as a quadratic equation in \(a\), \(a^{2} - 2 k b^{2} a + k(b^{3} - 1) = 0\), which has two solutions, say \(a_{1}\) and \(a_{2}\), one of which is in \(\mathbb{N}_{0}\). From \(a_{1} + a_{2} = 2 k b^{2}\) and \(a_{1} a_{2} = k(b^{3} - 1)\) it follows that the other solution is also in \(\mathbb{N}_{0}\). Suppose w.l.o.g. that \(a_{1} \geq a_{2}\). Then \(a_{1} \geq k b^{2}\) and 
\[ 0 \leq a_{2} = \frac{k(b^{3} - 1)}{a_{1}} \leq \frac{k(b^{3} - 1)}{k b^{2}} < b. \]
By the above considerations we have either \(a_{2} = 0\) or \(a_{2} = b / 2\). If \(a_{2} = 0\), then \(b^{3} - 1 = 0\) and hence \(a_{1} = 2 k, b = 1\). If \(a_{2} = b / 2\), then \(b = 2 t\) for some \(t\), and \(k = b^{2} / 4, a_{1} = b^{4} / 2 - b / 2\). Therefore the only solutions are 
\[ (a, b) \in \left\{(2 t, 1), (t, 2 t), \left(8 t^{4} - t, 2 t\right) \mid t \in \mathbb{N}\right\} \]
It is easy to show that all of these pairs satisfy the given condition.