Series summation if T ( n ) is given and n is very large | javascript program for the above approach ; Function to return the sum of the given series ; Driver Code
let MOD = 1000000007 ; function sumOfSeries ( n ) { let ans = Math . pow ( n % MOD , 2 ) ; return ( ans % MOD ) ; } let n = 10 ; document . write ( sumOfSeries ( n ) ) ;