use std::io::{self, BufRead, BufWriter, Write};
fn harmonious_pairs(n: usize) -> i64 {
let mut ans: i64 = 0;
let mut d = 1;
while d < n {
let v = n / d;
let next_d = std::cmp::min(n - 1, n / v);
let count = (next_d - d + 1) as i64;
ans += (v as i64 - 1) * count;
d = next_d + 1;
}
ans
}
fn main() {
let stdin = io::stdin();
let stdout = io::stdout();
let mut writer = BufWriter::new(stdout.lock());
let mut lines = stdin.lock().lines();
let t: usize = lines.next().unwrap().unwrap().trim().parse().unwrap();
for _ in 0..t {
let n: usize = lines.next().unwrap().unwrap().trim().parse().unwrap();
writeln!(writer, "{}", harmonious_pairs(n)).unwrap();
}
}