Anonymous user
AKS test for primes: Difference between revisions
m
→{{header|Nim}}
m (→{header|Nim}) |
m (→{{header|Nim}}) |
||
Line 2,542:
iterator polyExpansion(n: int): tuple[c, e: int] =
## Yield the
var e = n
for c in coeffs(n):
Line 2,549:
proc termString(c, e: int): string =
## Return the string for the
if e == 0:
result.addInt(c)
Line 2,569:
proc isPrime(n: int): bool =
## Check if
result = true
for (c, e) in polyExpansion(n):
|