import sys
sys.setrecursionlimit(3000)
# Memoization dictionary
memo = {}
def f(n):
if n in memo:
return memo[n]
if n == 1:
result = n
else:
result = n * f(n - 1) + n
memo[n] = result
return result
n = f(2024) - f(2023)
print(n / f(2022))
def f(n):
result = 1
for i in range(2, n + 1):
result = i * result + i
return result
f_2022 = f(2022)
f_2023 = f(2023)
f_2024 = f(2024)
n = f_2024 - f_2023
print(n / f_2022)
Результат print((lambda f: (f(2024) - f(2023)) / f(2022))(lambda n: (lambda r: [r := i * r + i for i in range(2, n + 1)][-1])(1)))