algorithm for some of the digits

join shbcf.ru