fork download
  1. local a
  2. a=2
  3. while a<11
  4. do
  5. local s,sum=2,1
  6. while s<(a/2)
  7. do
  8. if (math.mod(a,s)==0)
  9. then
  10. sum=sum+s
  11. end
  12. s=s+1
  13. print(math.mod(a,s))
  14. end
  15. if(sum==a)
  16. then
  17. print(a)
  18. end
  19. a=a+1
  20. end
Success #stdin #stdout 0.02s 2540KB
stdin
Standard input is empty
stdout
2
0
1
3
2
0
0
1
4
1
2
0