Skip to content

prime-sequence

The prime-sequence worked example.

Run it from sema/:

Terminal window
sema check examples/prime-sequence
SEMA_STRICT=1 sema run examples/prime-sequence
sema assure examples/prime-sequence --grade silver
"""Bounded exact prime indexing and inclusive prime counting."""
assure silver
equation prime_landmarks() -> any:
return (prime_nth(1), prime(100), prime_count(100), primepi(541))
test "prime aliases are exact and one based":
values = prime_landmarks()
check values[0] == 2
check values[1] == 541
check values[2] == 25
check values[3] == 100
def main() -> any !{}:
return prime_landmarks()

Bounded exact prime indexing and inclusive prime counting.

def main() -> any !{}

Returns any

Effects !{}