import itertools as it
def fib():
a, b = 0, 1
while True:
yield a
a, b = b, a + b
def asal_degil(n):
if n < 2:
return True;
if n % 2 == 0 and n !=2:
return True
k = 3
while k*k <= n:
if n % k == 0:
return True
k += 2
return False
def ilk_n_asal_fib(n):
sonsuz_asal_fibonacci_listesi = it.filterfalse(asal_degil,fib())
return list(it.islice(sonsuz_asal_fibonacci_listesi,n))
print(ilk_n_asal_fib(10))
##### sonuc
## [2,3, 5, 13, 89, 233, 1597, 28657, 514229, 433494437, 2971215073]
Soyle dursun bu burada. gerekli aciklamalari eleyecegim ileride