First term of incomplete series
$ term = ( $ count * $ k ) + 1 ; while ( $ n ) { if ( $ term <= $ n ) { $ arr [ $ i ++ ] = $ term ; $ n -= $ term ; $ term ++ ; } else { $ arr [ $ i ] += $ n ; $ n = 0 ; } }