Mathematically lucky tickets problem (developed for CheckIO.org)