You are right there are 1024 values, but there are 1023 intervals and the MAX value is 1023 and this latter is the important param for analogRead() formulas.

Let me explain

analogRead reads typically from 0..5V which is mapped from 0..1023

float voltage0 = 5.0 * analogRead(A0) /1023;

float voltage1 = 5.0 * analogRead(A0) /1024;

If analogRead == 0 both are 0 , we agree

if analogRead == 1023 we get

voltage0 = 5.0

voltage1 = 4.995 oops ?

but 1024 is faster

Yes using 1024 is far faster as /1024 can be replaced by a shift >> 10 ..........but it is fast wrong. OK only 0.1% but even 0.1%'s add up.

In your example of a 1 bit ADC there are two values 0 (minimum) and 1 (maximum)

the formula would be

voltage = 5.0 * analogRead() / 1;

if analogRead == 0 => voltage = 0

if analogRead == 1 => voltage = 5.0

Suppose we had an analogRead that had only 4 values from 0..1023. What would the divider be then? 4, 8, 1024 or 1023 or 17 or ..

There are 3 voltage ranges with 4 values :

0..341

342..682

683..1023

so n-bit resolution delivers 2^n voltage ranges... q.e.d.

Sorry, no q.e.d. today