If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Math for fun and glory

### Course: Math for fun and glory>Unit 2

Lesson 1: Brain teasers

# Light bulb switching brain teaser

Turning light bulbs on and off. Created by Sal Khan.

## Want to join the conversation?

• This brain teaser is on the fact that only squares have an odd number of factors. Similarly, only numbers of form a^(3x+1)b^(3y), where a, b are random integers have total factors not divisible by 3. By continuing this, we have a more generalized question.

Instead of going for multiples of n, we can go for multiples of n+k, where k is some decided number based on n. In this case, k=0.
Such as we can let k=floor(n/2)
Is there a method to solve this slightly generalized case?
• At , he says that a light bulb is on if it has an odd number of factors, so if the bulb number is prime, is it always off(except for 1)?
• Actually, a prime bulb will be touched twice and end up off at the end (except for 1, of course, but I don't know if 1 is even considered prime). It will be switched on at Pass One, and off at the pass that corresponds to its number- bulb 17 will be turned off at Pass 17, for example.
• first thing I made was the excel pattern :D After a while of looking for patterns till number 30 I noticed the square roots stayed on. Still feel like not sure why.
• I think i got the answer.is it that only one will be switched on
• I think the answer is 1 or 2...
• Here's an interesting scenario. What if we started with the light bulbs all switched on? Would the answer be the same?
(1 vote)
• If you started with everything switched on, then the result would be the reverse of what you would get if you started with the lights all off.
• I do not understand the pattern for number three. Is it on off off off on... and every 3 you turn a bulb on? If it is not, is there someone who understands it that can help me?
(1 vote)
• Every third light bulb you flip. If the light bulb was on, you turn it off. If the light bulb was off, you turn it on.