Pairwise Summation Approximation of Casimir energy from first principles