# Author: Steven Carr # Last Edited: October 2021 import stdio import sys # User input n = int(sys.argv[1]) # For integer in range 2 to n (1 can only be divided by itself) # Set total to 0 # for j in the range of 1 and i, if i is divisible by j, # add j to the total and repeat until the total is equal # to i. Then output i. for i in range(2, n+1): total = 0 for j in range(1, i): if i % j == 0: total = total + j if total == i: stdio.writeln(i)