easy puzzles
easy | general |
There are 100 Light bulbs in a sequence, all kept in OFF
state. The first person comes and toggles all the bulbs which are at position that is multiple of , i.e. switch all bulbs to ON
. The second person toggles all multiples of , i.e. turn the even numbered bulbs OFF
and leave the odd ones as is. The third person comes and toggles all multiples of . This process continues till the person do their part. After this, how many bulbs are in ON
state?
Consider bulb number 1 and 4, how is its outcome different than the others.
10 bulbs
Observation
Draw a small grid of 6x6 on a piece of paper and simulate the outcome.
Observe that each bulb is toggled as many times as many unique divisors it has. For example, bulb number 6 has divisors [1,2,3,6], so it is toggled back and forth by person number [1,2,3,6], i.e, 4 times.
In this case, only the bulb number and are ON
at the end of 6 steps, and they have odd number of divisors. Can it be that perfect square number have odd unique divisors?
Checking for some more numbers:
- Divisors for are , hence toggles
- Divisors for are , hence toggles
Hence we form a conjecture: For perfect squared numbers, the count of unique factors is always odd.
Proof: Divisors are always found in pairs. For number if we find one divisor then we also just found another divisor . The divisor count would increase by 2, unless which happens exactly once for a perfect square and never for any other number.
Note that for a non-square number, the count of unique divisors are always even.
A bulb at position is toggled between ON
/ OFF
states only by the person whose number is divisor of . When is a perfect square number then the bulb will be ON
at the end because of the odd sequence of toggling. For all the other numbers, the bulb will be OFF
because of the even sequence of toggling.
Thus bulbs 1,4,9....81,100 are ON, at the end.
Hence 10 bulbs are on.
Generalization
If there are bulbs in a sequence and people, then the number of bulbs that are ON
at the end is
Divisor Formula
Let be a positive integer and is the prime factorization of
In how many different ways can we form a divisor?
Let be a divisor of , where .
Thus, there are choices for each prime factor , indepdently for each .
Thus, the total number of divisors of is given by
If is a perfect square, then each is even, so is odd. Therefore, the product is odd.