It's because in case 2 you hold the array build result from the previous loop iteration in a shift register...in case 8 you do not...
You say that if you set the maximum number to three it will produce an array with three elements, that is not correct, it will run when the iteration index is 0,1,2 and 3...resulting in 4 elements. If you want 3 you need to decrement the maximum number to 2. The same goes for case 8.