維基百科上質數的定義為:
「指在大於1的自然數中,除了1和該數自身外,無法被其他自然數整除的數(也可定義為只有1與該數本身兩個因數的數)」
一個著名且有效率的方法:Sieve of Eratosthenes
用 Python 來實現 Sieve of Eratosthenes:
一個著名且有效率的方法:Sieve of Eratosthenes
用 Python 來實現 Sieve of Eratosthenes:
沒有留言:
張貼留言