Persisted array used

Used an array to persist a flag to identify if a number n should be
processed or not. A number N is not processed if N * 2 is already
processed ad the cycle length of N will be lesser for sure.