title: Syntax error on token ")", Statement expected after this token
body: <p>I have encountered a syntax error that I cannot figure out even with searching.</p>
  
  <p>The problem is on line 12, I have been attempting to use recursive.</p>
  
  <p>The full error is: </p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
      Syntax error on token ")", Statement expected after this token
  
      at Problem_14.main(Problem_14.java:12)
  </code></pre>
  
  <p>The code is: </p>
  
  <pre><code>import java.util.HashMap;
  import java.util.Map;
  
  
  public class Problem_14 {
  
      public static long sequence(long o) {
       long n = 0;
        if (o % 2 == 0) n = o/2; sequence(n); 
        if (o % 2 != 0) n = 3*o + 1; sequence(n);
        return n;
      }
  
  
      public static void main(String[] args) {
          Map&lt;String, Long&gt; chain = new HashMap&lt;String, Long&gt;();
          //Iterative sequence 
          //n → n/2 (n is even)
          //n → 3n + 1 (n is odd)
  
          for (int i = 1; i &lt; 1000000; i++) {
              chain.put(String.valueOf(i), sequence(i));
          }
      }
  
  }
  </code></pre>
  
  <p>I've done all of the recommendations to no avail.</p>