title: How to print an additional * after every 5th and following 3rd number in a positive integer sequence?
body: <p>I'm trying to print</p>
  <pre class="lang-none prettyprint-override"><code>1, 2, 3, 4, 5, *, 6, 7, 8, *, 9, 10, 11, 12, 13, *, 14, 15, 16, *, 17, ...
  </code></pre>
  <p>where an additional <code>*</code> should be printed after every 5th and following 3rd integer repeatedly.</p>
  <p>Here's my current code</p>
  <pre><code>for (int i = 1; i &lt;= 100; i++) {
      if (i % 5 == 0) {
          System.out.print(&quot;* &quot;);
      } else {
          System.out.print(i + &quot; &quot;);
      }
  }
  </code></pre>
  <p>which prints</p>
  <pre class="lang-none prettyprint-override"><code>1, 2, 3, 4, *, 6, 7, 8, 9, *, 11, 12, 13, 14, *, 16, 17, ...
  </code></pre>
  <p>What am I doing wrong here?</p>