Murray Gell-Mann did say once that he was annoyed by Feynman's tendency to invent anecdotes about himself. He wasn't lucky in the sense that he was a brilliant scientist but he also had a huge ego which he needed to validate publicly.
I could definitely see him totally making this up by working in reverse (decide to teach a lesson about mechanical vs. fundamental understanding, start with a tough operation, pick a mentally tractable number like a bit over 1728, tack on the simpler arithmetic contests before it to contrast and build tension), so I'm not saying it's a good argument for it being real. Just that it's tough to say one way or another.