Madelung rule