Number of Divisors of $m$ Such That They're All Less Than Some $n$

130 Views Asked by At

Recently I watched this Numberphile video. In it, they ask a rather interesting question.

Q. There are $100$ lightbulbs placed in a horizontal row. These bulbs are labelled from $1$ to $100.$ Initially, they are all switched off. Person $1$ comes along and switches every lightbulb on. Person $2$ comes and switches every second lightbulb off. Person $3$ comes along and changes the state of every third lightbulb. That is, if it's switched on, person $3$ switches it off, and if it's switched off, person $3$ switches it on. This continues till person $100$ changes the state of the last light bulb. After this, what lightbulbs are switched on, and what lightbulbs are switched off?

Once you realise that the number of times the state of a lightbulb changes is equal to the number of divisors $(≤100)$ it's label has, you can easily find out that those lightbulbs labelled with a perfect square are switched on, and the rest are all switched off.

I was thinking about generalisations of this question. Suppose we had $a\in\mathbb{N}$ lightbulbs with labels from $1$ to $a.$ What would the configuration be like after $b\in\mathbb{N}$ people completed their operations? If $b≥a,$ we have that all lightbulbs labelled with perfect squares less than or equal to $a$ are switched on, and the rest are all switched off. But, the $b<a$ case isn't so trivial (atleast to me). Suppose we take some $c\in\mathbb{N}$ such that $c≤a.$ Then, the number of times the state of the lightbulb labelled with $c$ changes is equal to $f(c,b),$ where $f(c,b)$ gives the number of divisors of $c$ such that they're all less than or equal to $b.$ If we can find a closed form for $f(c,b),$ then we can find out how many times each lightbulb has it's state changed.

This is the crux of my question. Does $f(m,n),$ for $m,n\in\mathbb{N}$ have any closed form? If $n≥m, f(m,n)=d(m),$ where $d$ is the regular number of divisors function. Apart from this, I haven't made any real progress on $f(m,n).$ I know that $f(m,n)$ goes up by $1$ each time it encounters a divisor of $m.$ That is, $f(m,n)=f(m,p)+1$ where $p$ is the greatest number less than $n$ such that $p|m,$ if $n|m.$ Otherwise, $f(m,n)=f(m,p),$ where $p$ is the greatest number less than $n$ such that $p|m.$ Any help in understanding $f(m,n)$ will be appreciated.