Jump to content

First 9 prime Fibonacci number: Difference between revisions

Fix Python solution to match output
(Added 11l)
(Fix Python solution to match output)
Line 1,230:
 
 
d = [1, 1]
a, b, = 1, 1
fibn = 3
f = []
while len(f) < n:
a, b, = b, a + b
d.append(b)
if prime(b):
f.append(b)
print("fib(%d): %s (%s s)" % (len(f)fibn, b, time() - start))
fibn += 1
</syntaxhighlight>
{{out}}
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.