- Find primary numbers
% primes p 20
[2 3 5 7 11 13 17 19]
- Factorize numbers
% primes f 329
[7 47]
- Reduce fractions
% primes r 144/360
2/5
- all can be executed in go code
package main
import (
"fmt"
"github.com/otiai10/primes"
)
func main() {
fmt.Println(
primes.Until(20).List(),
primes.Factorize(144).All(),
primes.Factorize(144).Powers(),
)
}
// [2 3 5 7 11 13 17 19]
// [2 2 2 2 3 3]
// map[2:4 3:2]
go get github.com/otiai10/primes/primes