Function to calculate the terms of summing of sum series
function sumX ( $ N , $ M , $ K ) { $ MOD = 1000000007 ; for ( $ i = 0 ; $ i < $ M ; $ i ++ ) { $ N = sum ( $ K + $ N ) ; } $ N = $ N % $ MOD ; return $ N ; }