I wish the article had talked about the legality of doing this. Assuming I'm not doing this to launder money and that I report all my earnings, is this legal?
I think so. Obviously, the lottery isn't happy if people actually figure out how to break it; but there are quite a few people who think "7 is lucky", and I can't figure out a good way to separate the actual winners from people who only think they are winners. And lotteries make their money from the latter...
Not a lawyer, but I would be very surprised if the law that creates and regulates the lottery doesn't include a clause to make buying tickets by an algorithm illegal or something like it.
Why? The law says that you can buy tickets, and return unused ones. So just buy a bunch, scratch the winning ones, and return the rest.
There's no law which says that "if you can figure out how the lottery works, it is illegal". Their recourse is to only pull the lottery and discontinue it; they can't accuse you of fraud if you somehow figured out how to pick the right tickets.