# [Python 3], 46 bytes <!-- language-all: lang-python --> lambda x:sum(i for i in range(1,x)if x%i<1)==x [Try it online!][TIO-jt58ypeb] Brute force, sums the factors and checks for equality. [Python 3]: https://docs.python.org/3/ [TIO-jt58ypeb]: https://tio.run/##Xc69DoIwEMDx2T7FBWPSJje0YJtC5AHc3NUBleoR@Qhigk9fISpRlxsu/1/umkd3qavIu3Tnr1l5OGXQJ7d7yQlc3QIBVdBm1TnnCntBDvoFrZRI095T2eSty48dpLBVqEJUESqLoUQlpdzDHCGKtJbDYOyrNRhaXMYGrQrtmL2rYaFtbE0stRlAS1XHg/XnShIINr003U7Y7BUSguMkxAQ3v6wY2T8qRlQMyD8B "Python 3 – Try It Online"