why will this uno sketch not work with a Nano

That indicates a communcation problem. If, in the Tools menu, the right board and serial port are available (necessary drivers are installed) and selected the next thing to check is the USB cable.