public class Solution { public static void main(String[] args) { double sum; double item; for(int i = 10000; i<= 100000; i += 10000) { item = 1; sum = 0; for(int j = 1; j <= i; j++) { item = item * 1.0 / i; sum += item; } System.out.println("i = " + i + ", e = " + sum); } } }