What are the bases of an algorithm for discovering patterns of a lottery?

Top