3 ms·
With doubles in Python, it's correct for the first 72 values. fib = lambda n: int(((((1+5**.5)/2)**n)-(((1-5**.5)/2)**n))/5**.5)
by Scaevolus 8y ago
With doubles in Python, it's correct for the first 72 values.
fib = lambda n: int(((((1+5**.5)/2)**n)-(((1-5**.5)/2)**n))/5**.5)
- daveFNbuck 8y agoIf you only need the first 72 values, the speed doesn't really matter. You can just build the table once and do lookups.