1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
import math def digits(number): return math.ceil(math.log10(number+1)) prev = 1 next = 1 count = 2 while(True): if(digits(next) >= 1000): break tmp = next next += prev prev = tmp count += 1 print count