OFFSET
0,6
MATHEMATICA
a[n_] := Module[{}, r=Floor[(Sqrt[8n+1]-1)/2]; s=n-r*(r+1)/2; For[k=0, True, k++, If[s<Binomial[r-s+1+k, k], Return[k]]]]
CROSSREFS
KEYWORD
AUTHOR
Jared Ricks (jaredricks(AT)yahoo.com), Jan 31 2002
EXTENSIONS
Edited by Dean Hickerson, Feb 16 2002
STATUS
approved