public class Compute
{
    public static final int[] BASE_PATTERN = {0, 1, 0, -1};

    public Compute (boolean debug)
    {
        _debug = debug;
    }

    public int[] process (int[] input, int numberOfPhases)
    {
        int[] results = input;

        for (int i = 0; i < numberOfPhases; i++)
        {
            results = processPhase(input);
        }

        return results;
    }

    private int[] processPhase (int[] input)
    {
        int[] results = new int[input.length];
/*
        for (int i = 0; i < input.length; i++)
        {
            int[] basePattern = getBasePattern(i+1);

            for (int j = 0; i < basePattern.length; j++)
            {
                int[] work = new int[input.length];

                work[j] = input[j] * basePattern[j];

                System.out.println(input[j]+"*"+basePattern[j]);
            }
        }*/

        getBasePattern(1, input.length);
        getBasePattern(2, input.length);

        return results;
    }

    /*
     * A reminder of the example ...
     * 
     * 10-1010-10
     * 01100-1-10
     * 00111000
     * 00011110
     * 00001111
     * 00000111
     * 00000011
     * 00000001
     * 
     * 10-1010-1010-1010-1  --> miss first digit [010-1010-1010-1]
     * 01100-1-1001100-1-1  --> miss first digit [001100-1-1]
     * 00111000-1-1-1000111000-1-1-1  --> miss first digit [000111000-1-1-1]
     * 00011110000-1-1-1-1000011110000-1-1-1-1  --> miss first digit [000011110000-1-1-1-1]
     * 00001111100000-1-1-1-1-1  --> miss first digit [000001111100000-1-1-1-1-1]
     */

    private final int[] getBasePattern (int phase, int size)
    {
        int[] data = new int[size];
        int basePtr = 1;
        int loop = 0;

        System.out.println("\nbase pattern ...");
        
        for (int i = 0; i < data.length; i++)
        {
            //if (i == 0)
            //    loop = 1;

            data[i] = BASE_PATTERN[basePtr];

            //if (_debug)
                System.out.println("Base pattern entry "+i+" is "+data[i]);

            loop++;

            if (loop == phase)
            {
                loop = 0;
                basePtr++;

                if (basePtr == BASE_PATTERN.length)
                    basePtr = 0;
            }
        }

        return data;
    }

    private boolean _debug;
}
@@ -953,16 +953,98 @@
 length);
+%0A        getBasePattern(3, input.length);%0A        getBasePattern(4, input.length);
 %0A%0A      
@@ -1749,16 +1749,18 @@
 int%5Bsize
++1
 %5D;%0A     
@@ -1776,17 +1776,17 @@
 sePtr = 
-1
+0
 ;%0A      
@@ -1856,17 +1856,9 @@
 %22);%0A
-        
 %0A
+
     
@@ -1913,63 +1913,8 @@
   %7B%0A
-            //if (i == 0)%0A            //    loop = 1;%0A%0A
     
@@ -2300,19 +2300,184 @@
     
-return data
+// crop the first element%0A        %0A        int%5B%5D toReturn = new int%5Bsize%5D;%0A%0A        for (int j = 0; j %3C size; j++)%0A            toReturn%5Bj%5D = data%5Bj+1%5D;%0A%0A        return toReturn
 ;%0A  

Update Compute.java