t6163.nim 291 B

123456789101112131415161718
  1. discard """
  2. exitcode: 0
  3. targets: "c cpp js"
  4. output: '''19316
  5. '''
  6. """
  7. from sugar import `->`, `=>`
  8. from math import `^`, sum
  9. from sequtils import filter, map, toSeq
  10. proc f: int =
  11. toSeq(10..<10_000).filter(a => a == ($a).map(d => (d.ord-'0'.ord).int^4).sum).sum
  12. var a = f()
  13. echo a