sum where m goes from 1 to n of m^(2^k)