To get a reading of 1023 (you shouldn't see 1024 at all) you can also connect the A0 directly to the 3.3V.