This is happening because the printer has a feature called Wi-Fi Direct and it is on. Windows 10 can detect Wi-Fi Direct and tries to add the printer to Windows for you - automatically. The PIN is a must have for security reasons. Pretty cool if you know where the PIN is. Not so cool if you don't.
The PIN appears in the little screen on your printer. If your printer doesn't have a little screen, the printer prints out the code...but this isn't going to happen if you haven't yet installed paper and ink/toner.
So... to get past this, click Cancel and make sure paper and ink/toner are installed before messing with the stuff in Windows.
Once the printer has ink/toner, paper, finishes calibrating (some printers)... and is all ready-to-go, then go back to Windows. Search Windows for "add printer" to bring up the Printers & Scanners page. Now you can add the "Direct" printer and get the PIN from the little Window or the page that prints.
Even better... go to www.123.hp.com to download the software it recommends and follow the prompts.