Series summation if T ( n ) is given and n is very large | Java implementation of the approach ; Function to return the sum of the given series ; Driver code
class GFG { public static final int MOD = 1000000007 ; static int sumOfSeries ( int n ) { int ans = ( int ) Math . pow ( n % MOD , 2 ) ; return ( ans % MOD ) ; } public static void main ( String [ ] args ) { int n = 10 ; System . out . println ( sumOfSeries ( n ) ) ; } }