Mean of fourth powers of first N natural numbers | Function to find the average of the fourth power of first N natural numbers ; Store the resultant average calculated using formula ; Return the average ; Driver Code
function findAverage ( N ) { let avg = ( ( 6 * N * N * N * N ) + ( 15 * N * N * N ) + ( 10 * N * N ) - 1 ) / 30.0 ; return avg ; } let N = 3 ; document . write ( findAverage ( N ) . toFixed ( 4 ) ) ;