OFFSET
0,4
COMMENTS
Maximum of any sum_i k_i, where sum_i k_i*(k_i+1)/2 <= n.
FORMULA
For n > 2, let m be the largest value such that tetrahedral number m*(m+1)*(m+2)/6 <= n. Then a(n) = max(m*(m+1)/2, m+1 + a(n - (m+1)*(m+2)/2)), taking a(k) to be 0 for k < 0.
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Jun 14 2006
STATUS
approved