title: Java recursion to output number pattern
body: <p>Required output:</p>
  
  <pre><code>    5
     454
    34543
   2345432
  123454321
  </code></pre>
  
  <p>How can I do this using recursion? I have the code idea which is:</p>
  
  <pre><code>public static void main(String[] args)
  {
        System.out.println(func(5)); 
  }
  public static String func(int num)
  {
       return num + "" +meth(num-1, num, num-1);
  }
  
  public static String meth(int start, int num, int end)
  {
  
      if(start==1)
      {
          return "1";
      }
      System.out.println(start+num+end);
  
      return meth(start-1, num, end-1);
  }
  </code></pre>
  
  <p>I am confused about what to return in the if statement and the System.out.println(),
  because the number 5 won't decrease/increase as it will stay for example, it will stay 5 vertically, how can I deal with this problem?
  my code is more of an illustration just to prove that I am doing it.</p>