Sum The Series
CodeChefOpen on judge ↗
Sum the given series. T(n)=n^2 - (n-1)^2 S= T(1) + T(2) + T(3) + .. ... ... ..+ T(n) You need to print S where nth term is given as T(n). Input First line of the input contains T mentioning the number of test cases. Each test case contains a single integer n. Output Print S mod 109 + 7 in a new line for each test case. Constraints - 1 ≤ T ≤ 10 - 1 ≤ n ≤ 1016 Example Input: 2 3 2 Output:
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start