Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How about brute force? This consists of $O(n^3)$ steps (the verification of positive integers $x,\, y,\, z\, $ s. t. $x+y+z \le n$) in your case.
How about brute force? This consists of $O(n^3)$ steps in your case.