โ† PharmEasy questions

Count remaining turned-on bulbs after n rounds

Filed under PharmEasy

The question

Given n initially off bulbs, in the first round you turn on all bulbs, in the second round you turn off every second bulb, and in the i-th round you toggle every i-th bulb up to n rounds. Find how many bulbs remain on.

No write-up yet. Related questions below have one.

Related PharmEasy questions

Collected from public candidate posts and coding forums. Updated Nov 2026.