"The Arduino has a system clock of 16MHz and the timer clock frequency will be the system clock frequency divided by the prescale factor. Note that Timer 2 has a different set of prescale values from the other timers. "
sniffing1987:
AnalogRead gives values from 0-1023 but AnalogWrite will only give values from 0-253 so you need to map the values across.
analogWrite() can take values from 0 to 255 (as per the size of an unsigned char). What is 1023/4 ? (hint, truncate the decimal, that's how computers work).
You can save time and RAM by simply doing:
byte x = (analogRead(1) >> 2); //Note the bit shifts, rather than the division. I have a sneaking suspicion though that GCC optimises out the division anyway