Charlie's Delightful Machine

Enter some whole numbers in the box and so discover the rules which switch on each of the lights.

Pressing a level button generates a new rule