Sum of first n terms
Submissions: 4047   Accuracy:

10.65%

  Difficulty: Basic   Marks: 1

Given and integer n. Print the sum of series 13 + 23 + 33 + 43 + …….+ n3 till n-th term.

Input:
The first line consists of an integer T i.e number of test cases. The first and only line of each test case consists of an integer n. As the output could be large so take mod with 109+7.

Output:
Print the required sum.

Constraints: 
1<=T<=100
1<=n<=109

Example:
Input:

2
5
7

Output:
225
784

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.