The series, 11 + 22 + 33 + … + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + … + 10001000.
BigInteger number = BigInteger.ONE; BigInteger result = BigInteger.ZERO; for (long i = 1; i <=1000; i++) { number = BigInteger.valueOf(i); result = result.add(number.pow((int)i)); } String output = result.toString(); System.out.println(output.substring(output.length()-10));
Lösung: 9110846700