Now that I think of it, I'm thinking I could have two arrays. The OFF array and the ON array. Then move the LEDs from one to the other. Is this a good approach?
You could do that, but, think about this for a minute. You have one array. Each position in the array corresponds to an LED. The LED is either ON or OFF, so the value in the array is either HIGH or LOW.
If you have two array, OFF, and ON, what do the positions in the array correspond to?
Upon further reflection, you really do need two arrays - an array of pin numbers and an array of states.
When the number of LEDs on is too high or too low, you must choose an LED to change the state of.
So, you set up an infinite loop. In that loop, you generate a random number between 0 and the number of LEDs you have. If the state of the LED in that position in the array is the same as the new state (already on or already off, do nothing. The loop will repeat, and pick a new random number.
On the other hand, if the state of the LED in that position in the array is not the same as the new state, change the state of that position in the array, and of the corresponding pin number, and break out of the loop.