n = gets.to_i result = [] n.times{ p = gets.to_i count = (p-1) * p * (2 * p - 1) / 6 - (p-1)*p/2 result << count * 2 } puts result