Wrapper function
function wrapper ( q , n ) { var digitSum = Array ( N ) . fill ( 0 ) ; var factorDigitSum = Array ( N ) . fill ( 0 ) ; sumOddDigit ( digitSum ) ; sumFactor ( digitSum , factorDigitSum ) ; for ( var i = 0 ; i < q ; i ++ ) document . write ( factorDigitSum [ n [ i ] ] + " " ) ; }