using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray(); public static void Main() { Solve(); } static void Solve() { var cache = Enumerable.Repeat(-1L, 10_000_001).ToArray(); var t = NN; var ans = new long[t]; for (var u = 0; u < t; ++u) { var n = NN; ans[u] = (long)n * (n - 1) - A015614(n, cache); } WriteLine(string.Join("\n", ans)); } static long A015614(int n, long[] cache) { if (n == 0) return -1; if (cache[n] >= 0) return cache[n]; var c = 2L; var j = 2; var k1 = n / j; while (k1 > 1) { var j2 = n / k1 + 1; c += (j2 - j) * (2 * A015614(k1, cache) + 1); j = j2; k1 = n / j2; } var ans = ((long)n * (n - 1) - c + j) / 2; cache[n] = ans; return ans; } }