PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
import threading
from functools import lru_cache
def main(n = 100_000):
@lru_cache
def fib(n):
return n if n < 2 else (
fib(n - 1) + fib(n - 2))
res = str(fib(n))
print(f"{len(res) = }\n{res}")
sys.setrecursionlimit(250_000)
sys.set_int_max_str_digits(25_000)
threading.stack_size(137_000_000)
t = threading.Thread(target=main)
t.start()
t.join()
# Vitaly Sokol, Feb 16, 2025.
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run