Carol Numbers
Submissions: 482   Accuracy:

11.17%

  Difficulty: Easy   Marks: 2

Find the nth Carol Number.

A Carol number is an integer of the form 4n – 2(n+1) – 1. An equivalent formula is (2n-1)2 – 2.

Input:
First line of input contains the number of test cases. Only line of each test case contains a single integer n.

Output:
Print the nth Carol number mod 1000000007

Constraints:

1<=T<=10^6

1<=N<=10^9

Example:
Sample Input:
2
2
4

Sample Output:

7
223 

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

Author: jain_rishabh


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.