fork(1) download
  1. # coding: utf-8
  2. N = 99
  3. for i in range(N+1):
  4. count = 0
  5. j = i
  6. while j > 0:
  7. if j%2 == 1:
  8. count += 1
  9. j //= 2
  10. if count%2 == 1:
  11. print(i, end=" ")
  12. print()
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
1 2 4 7 8 11 13 14 16 19 21 22 25 26 28 31 32 35 37 38 41 42 44 47 49 50 52 55 56 59 61 62 64 67 69 70 73 74 76 79 81 82 84 87 88 91 93 94 97 98