Calculating the coulombic energy of a crystal using the classic Madelung sum formulation