public static void findLoop(long world) throws Exception
  {
    long[] previousVal = new long[100];
    previousVal[0] = world;
    int iter = 1;
    boolean done = false;
    while (!done && iter < 100)
    {
      previousVal[iter] = nextGeneration(previousVal[iter-1]);
      for (int i=0;i<iter;i++)
      {
        if (previousVal[i] == previousVal[iter])
        {
          done = true;
          System.out.println(i + " to " + (iter-1));
          break;
        }
      }
      iter++;
    }
    if (!done) System.out.println("No loops found");
  }