5. Garland (1 b. 6-11). A string of 100 lights was hung on a Christmas tree in a row. Then the lights started switching according to the following algorithm: all lights turned on, after a second, every second light turned off, after another second, every third light switched: if it was on, it turned off and vice versa. After another second, every fourth light switched, then every fifth light, and so on. After 100 seconds, everything was over. Find the probability that a randomly chosen light is on after this (the lights do not burn out or break).
Solution. Obviously, the bulb with number $n$ will remain on only if it has been switched an odd number of times, that is, if the number $n$ has an odd number of natural divisors. It is clear that only squares satisfy this condition: $n=1,4,9, \ldots, 100$. Thus, 10 bulbs out of 100 will remain on. Therefore, the probability of randomly selecting a bulb that is on is $0.1$.