Задание 5 Номер КИМ: 16

 avatar
user_8840555
python
a year ago
384 B
1
Indexable
Never
def f(n):
    if n <= 19:
        return n * n * n + 22
    if n % 3 == 0 and n > 19:
        return f(n - 4) + f(n - 8)
    if n % 3 != 0 and n > 19:
        return f(n - 9) + n + 7


c = 0
for n in range(1, 101):
    s = str(f(n))
    if s.count('1') == 0 and s.count('3') == 0 and s.count('5') == 0 and s.count('7') == 0 and s.count('9') == 0:
        c += 1
print(c)