title: Number Patterns using loops in Java
body: <p>I have been trying different variations of for loops and have no clue how to make these patterns:</p>
  
  <p>Pattern 1</p>
  
  <pre><code>54321
  5432
  543
  54
  5
  </code></pre>
  
  <p>Pattern 2</p>
  
  <pre><code>    1
     12
    123
   1234
  12345
  </code></pre>
  
  <p>Pattern 3</p>
  
  <pre><code> 12345
    2345
     345
      45
       5
  </code></pre>
  
  <p>Pattern 4</p>
  
  <pre><code>  1
   123
  12345
   123
    1
  </code></pre>
  
  <p>My code that almost matched pattern 1 is the following but doesn't work like the example above.</p>
  
  <pre><code>for (int i = 1 ; i &lt;= rows ; i++) {
      for (int j = (rows + 1 - i) ; j  &gt; 0 ; j-- ) {
          System.out.print(j);
      }   
      System.out.print("\n");
  }
  </code></pre>