Skip to main content
deleted 5 characters in body
Source Link
Neil A.
  • 2.1k
  • 8
  • 23

Python 3, 4946 bytes

lambda x:sum([ii for i in range(1,x)if x%i==0]x%i<1)==x 

Try it online!

Brute force, sums the factors and checks for equality.

Try it online!

Python 3, 49 bytes

lambda x:sum([i for i in range(1,x)if x%i==0])==x 

Brute force, sums the factors and checks for equality.

Try it online!

Python 3, 46 bytes

lambda x:sum(i for i in range(1,x)if x%i<1)==x 

Try it online!

Brute force, sums the factors and checks for equality.

Source Link
Neil A.
  • 2.1k
  • 8
  • 23

Python 3, 49 bytes

lambda x:sum([i for i in range(1,x)if x%i==0])==x 

Brute force, sums the factors and checks for equality.

Try it online!