Double PWM signals with High frequency

If you could get the Arduino to output 40KHz you run the signal to a D flip-flop set up as a divide-by-2 which would bring it back down to a 20KHz square wave.