Protip: If you have a 6x31 Ditto, it's been hacked, period. The obvious ID number helps, but seriously - there are 6 stats, and 32 possible values for each. A 6x31 IV Ditto is a 1-in-32
6 chance, which is a 1-in-1,073,741,824 chance. Yes, that's literally one in a
billion. If you assume this Ditto was caught in the Friend Safari (2 guaranteed 31 IVs), then the chance is improved to approximately 1-in-1,048,576, or one in a million (depending slightly on how, exactly, the two fixed IVs are handled).
Assume it takes roughly one minute (60 seconds) to capture one Ditto, including time required to find one (running from unwanted encounters), weaken one (capture rate of 35, so not easy), and capture one. One minute is absolutely an underestimate, but it makes my math easier.
With the 1-in-32
6 chance, the odds of capturing a Ditto are 50% at (1-(1/32
6)
x = 0.5. Thus, it would take on average
x = 7.44261x10^8 attempts. At one minute per capture attempt, it would take just over 1415
years of attempting captures, 24 hours per day, to have even a 50% chance of capturing a single perfect-IV Ditto.
Of course, the odds improve considerably with the Friend Safari. Now, we get x = 726817 attempts, or ~500 days at one minute per attempt to achieve a 50% capture chance. Pokemon X/Y was released on October 12, 2013, so we've had considerably fewer than 500 days elapsed since the game released. If someone got the game, instantly completed it, and then spent 24 hours a day capturing Dittos at a physically-impossible rate, they still would have far less than a 50% chance to capture a perfect Ditto.
Now, to be fair, we're not talking near-zero-percent-before-the-heat-death-of-the-universe probabilities here, so it's
possible that someone, somewhere, has actually captured a 6x31 IV Ditto. After all, an awful lot of hours have been pumped into Pokemon by people worldwide, and presumably a decent number of those hours have been dedicated by people farming Dittos. But we're now also assuming that someone caught this Ditto, recognized their one-in-a-billion luck, and proceeded to trade their ridiculous prize on the open market. The far, far more likely outcome is this Ditto was hacked, or it was obtained via RNG manipulation and cloned repeatedly.
TL;DR: Yep, 100% hacked. Above math says it would take years of full-time work to get a perfect Ditto.
Disclaimer: was not expecting to be crunching statistics tonight, may have previously hindered my critical thinking skills with BEvERages. Mistakes may have been made.