The standard implementation would use a hard coded set of patterns. The enhanced version would pair automatic random code generation with a public site where members of the public can decide in real time whether a given code is "nice" before it's sent along to the intended recipient.
(note @tptacek if you're reading this, I swear it's (mostly) a joke)
What’s the actual likelihood of seeing the same TOTP code from different apps at different times?
What about those ones that get sent out in phone messages?
There’s only a million 6 digit TOTP codes, so I reckon you get to 50% odds of collision at ~1200 values.
With a calculator [1], we can find the exact amount. plugging in D=10^6 (# of unique codes) with P=0.5 (odds of collision) gives you 1178 values.
Sqrt(1 000 000) = 1 000, close enough to the exact number you calculated.
That's about 1.17741 times \sqrt(N).
The reasons are explained here: https://news.ycombinator.com/item?id=40886363