Step-by-step explanation:
Since it remains only 1 sweet, we can subtract it from the total and get the amount of sweets distributed (=1024).
As all the sweets are distributed equally, we must divide the number of distributed sweets by all its dividers (excluding 1024 and 1, we'll see later why):
1) 512 => 2 partecipants
2) 256 => 4 partecipants
3) 128 => 8 partecipants
4) 64 => 16 partecipants
5) 32 => 32 partecipants
6) 16 => 64 partecipants
7) 8 => 128 partecipants
9) 4 => 256 partecipants
10) 2 => 512 partecipants
The number on the left represents the number of sweets given to the partecipants, and on the right we have the number of the partecipants. Note that all the numbers on the left are dividers of 1024.
Why excluding 1 and 1024? Because the problem tells us that there remains 1 sweet. If there was 1 sweet for every partecipant, the number of partecipants would be 1025, but that's not possible as there remains 1 sweet. If it was 1024, it wouldn't work as well because the sweets are 1025 and if 1 is not distributed it goes again against the problem that says all sweets are equally distributed.