NOTE: Too much for spoiler tags, so I only did the last.
EDIT: After all that work, I find out I have the same answer as wythagoras.
If all seven lights are on, there is one possible digit.
If six lights are on, there are 7 ways you can remove a single light from the "all on" case, so there are 7 digits with six lights.
There are $_7C_5=21$ ways to get digits with 5 lights, but a couple of them (2) are disconnected.
Therefore, there are 19 digits with 5 lights.
There are $_7C_4=35$ ways to do this. However, with three lights off, there are a few ways you can have a disconnected light. As before, we saw two ways in which there were disconnected lights with five lights. In each of those, we can turn off a light in the "o" section and still be disconnected. This is a total of 8 ways to disconnect. Also, if you turn on the two lights in opposite corners they will be disconnected. There are 2 ways to do this.
Also, you can orphan a vertical piece as follows;
| | |
| | | |
There are 4 ways to do this.
Lastly, you can have two vertical bars disconnected by turning off all three horizontal lights.
Thus, the total number of ways to have four lights is 35-8-2-4-1=20.
With three lights, you can have a "C" and "U" and "n" and backwards "C", both on the top and on the bottom for a total of 4x2=8. Also, you can have "7" and "L" and their reverse for a total of 4. You can have a left "T" and a right "T" for 2 more. And finally, you can have an "H" missing the top left and bottom right (kind of a zig zag), or its reverse, for a total of 2 more. Grand total is 16.
You can have 4 "L" shaped pieces around every corner on the top and another 4 on the bottom. Also, you can have 2 vertical digits; one on the left and one on the right. Total is 10.
There are 7 digits with 1 light trivially.
So, the total is: