improve powsum for integer s