Given an integer n, find the nth Pentagonal number. First three pentagonal numbers are 1, 5 and 12 (Please see below diagram).The n’th pentagonal number Pn is the number of distinct dots in a pattern of dots consisting of the outlines of regular pentagons with sides up to n dots, when the pentagons are overlaid so that they share one vertex.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains the integer N.
Print the n'th pentagonal number for each test case in a new line.
1 <= T <= 100
1 <= N <= 100000
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.