8 lines
141 B
Python
8 lines
141 B
Python
|
|
def aks(p):
|
||
|
|
if p==2:return True
|
||
|
|
c=1
|
||
|
|
for i in range(p//2+1):
|
||
|
|
c=c*(p-i)//(i+1)
|
||
|
|
if c%p:return False
|
||
|
|
return True
|