title: Find four consecutive numbers that sum to given number
body: <p>Suppose there is a given number we should test if it is product of four consecutive numbers?</p>
  
  <p>So if <code>y</code> is our given number we should test if <code>y = x(x+1)(x+2)(x+3)</code> for any arbitrary <code>x</code>?</p>
  
  <p>How to design an algorithm for this problem?</p>
  
  <p>I have done it like this:</p>
  
  <pre><code>import java.util.*;
  
  public class Product 
  {
      public static int product(int i)
      {
           return i * (i+1) * (i+2) * (i+3);
      }
  
      public static void main(String[] args) 
      {
          Scanner scnr = new Scanner(System.in);
          int x = scnr.nextInt();
          for (int i = 0; i &lt; x/2; i++)
          {
              if (product(i) == x)
              {
                  System.out.println("number is product of 4 consecutive numbers");
                  break;
              }
          }
      }
  }
  </code></pre>