fork(1) download
  1. importPackage(java.io);
  2. importPackage(java.lang);
  3.  
  4. var reader = new BufferedReader( new InputStreamReader(System['in']) );
  5. var limit = reader.readLine();
  6.  
  7. for(i = 7; i < limit; ++i) {
  8. if(!isConstructible(i))
  9. System.out.print(parseInt(i) + " ");
  10. }
  11.  
  12. function isConstructible(n) {
  13. while(n%2 == 0)
  14. n >>= 1;
  15. return n == 1 || n == 3 || n == 5 || n == 17 || n == 257 || n == 65537;
  16. }
Success #stdin #stdout 0.44s 381952KB
stdin
100
stdout
7 9 11 13 14 15 18 19 21 22 23 25 26 27 28 29 30 31 33 35 36 37 38 39 41 42 43 44 45 46 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 65 66 67 69 70 71 72 73 74 75 76 77 78 79 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 97 98 99