Sum of fifth powers of the first n natural numbers
Submissions: 4210   Accuracy:

20.86%

  Difficulty: Basic   Marks: 1

You will be given a number N. Your task is to find sum of Fifth powers of the first N natural numbers 15 + 25+ 35 + 45+ …….+ N5 till N-th term.

Input:
The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N.

Output:
For each test-case, print sum of Fifth powers of the first N natural numbers 15 + 25+ 35 + 45+ …….+ N5 till N-th term.

Constraints:
1 <= T <= 1000
1 <= N <= 1000

Example:

Input:
3
1
2
3

Output:
1
33
276

Explanation:

For testcase 2: The first 2 natural numbers are 1 and 2. So 15+25=1+32=33

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

Contributor: Ankit Sharma
Author: Soul_xhacker


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.