The arithmetic of power series and applications to periods