fork download
  1. def sum_dig_pow(a, b):
  2. def _check_dig(dig):
  3. return dig == sum(int(a)**i for i,a in enumerate(str(dig), 1))
  4.  
  5. return list(filter(_check_dig, range(a, b+1)))
  6.  
  7. print (sum_dig_pow(10, 100000))
  8.  
Success #stdin #stdout 0.31s 9252KB
stdin
Standard input is empty
stdout
[89, 135, 175, 518, 598, 1306, 1676, 2427]