@@ -0,0 +1,1051 @@
+//https://www.hackerrank.com/challenges/summing-the-n-series%0D%0Aimport java.io.*;%0D%0A%0D%0Apublic class Solution%7B%0D%0A    %0D%0A    private final static int MOD = 1000000007;%0D%0A    %0D%0A    public static void main(String%5B%5D args) throws IOException %7B%0D%0A        StringBuffer sb = new StringBuffer();%0D%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0D%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0D%0A            long N = Long.parseLong(br.readLine());%0D%0A            N = N%25MOD;%0D%0A            int sN = (int)((N*N)%25MOD);%0D%0A            sb.append(sN + %22%5Cn%22);%0D%0A        %7D%0D%0A        System.out.print(sb);%0D%0A    %7D%0D%0A%7D%0D%0A/*%0D%0AT(n) = n%5E2 - (n-1)%5E2%0D%0A%0D%0ASquares%0D%0A-------%0D%0A0: 0%0D%0A1: 1%0D%0A2: 4%0D%0A3: 9%0D%0A4: 16%0D%0A5: 25%0D%0A6: 36%0D%0A7: 49%0D%0A8: 64%0D%0A9: 81%0D%0A10: 100%0D%0A%0D%0ASeries sum up to n%0D%0A------------------%0D%0A1: T(1) = (1 - 0) = 1 = 1%0D%0A2: T(2) + T(1) = (4 - 1) + (1 - 0) = 3 + 1 = 4%0D%0A3: T(3) + T(2) + T(1) = (9 - 4) + (4 + 1) + (1 - 0) = 5 + 3 + 1 = 9%0D%0A4: T(4) + T(3) + ... = (16 - 9) + (9 - 4) + ... = 7 + 5 + 3 + 1 = 16%0D%0A...%0D%0An: T(n) + T(n-1) + ... T(1) = n%5E2%0D%0A*/

Add summing-the-n-series solution