title: Better solution for finding numbers with exactly 3 divisors
body: <p>I was studying some programming and I found an exercise to write an algorithm finding "threesome numbers" (numbers that are divisible by exactly 3 numbers). I wrote this:</p>
  
  <pre><code>function threesomeNumber(N) {
      var found = 0;
      var i = 1;
      var numberOfDivisions = 1;
      while (found &lt; N) {
          for (var j = 2; j &lt;= i; j++) {
              if (i % j === 0) {
                  numberOfDivisions++;
              }
          }
          if (numberOfDivisions === 3) {
              found++;
              console.log(found + " = " + i);
          }
          numberOfDivisions = 1;
          i++;
      }
  }
  </code></pre>
  
  <p>The problem is it's running kinda slow and I was wondering if it can be done quicker. Does anybody know of a more optimized solution? I want it to find N consecutive threesome numbers.</p>