=begin The series, 11 + 22 + 33 + ... + 1010 = 10405071317. Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000. =end max = 1000 total = 0 1.upto max do |n| total += n**n end print total.to_s[-10,10]