Find the largest number of distinct integers that sum to n
05AB1E, 4 bytes

ÅTg&lt;


Try it online!

Perfect tool for the job.

ÅT yields the list of Åll Triangular numbers up to and including N (unfortunately includes 0 too, otherwise it would be 3 bytes), g&lt; gets the length and decrements it.