Де помилка? чому не виводить результат?
N=int(input())
s=input()
for i in range(1,N):
if int(i**0.5)==i**0.5:
s+=i
print (s)