Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

sieve package

Overview

Package sieve is an on-chain port of Go's classic concurrent prime sieve (the "prime sieve" example from the Go tour / Go source docs), implemented as a deterministic, allocation-friendly Sieve of Eratosthenes so it runs reproducibly on-chain (no goroutines, channels, or clocks).

Function

PrimesUpTo

func PrimesUpTo(n int) []int

PrimesUpTo returns every prime p with 2 <= p <= n, in ascending order, using the Sieve of Eratosthenes. n is clamped to [0, MaxN]. Pure.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/sieve.PrimesUpTo()"

Result