Skip to main content
2 of 2
added 77 characters in body
user64494
  • 3.5k
  • 14
  • 22

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.

user64494
  • 3.5k
  • 14
  • 22