python代码
M = int(input())
if M == 1 or M == 2:
print("1")
else:
d = [1 for i in range(M)]
i = 2
while i <= M:
index = 0
while index < M:
if (index+1) % i == 0:
d[index] = -d[index]
index += 1
i += 1
s = 0
while s < M:
if d[s] == 1:
print(s+1,end=" ")
s += 1



