Just had the "locked out" problem on my G3.
Followed the advice here and did a factory reset, but was still asked for the pin code after that.
Tried a few numbers until it asked me for the PUK code.
Called my phone company (Virgin) and received the code, all up and running in minutes...