PrimeSieve

command
v0.0.0-...-a656574 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package prime provides functionality to produce prime numbers using all available cpu cores. https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes can be an starting point to find more information about how to calculate prime numbers.

The method used in Primes function is Segmented sieve. Segmenting will Reduce memory requirement of process. The space complexity of the algorithm is O(√n).

From https://github.com/kavehmz/prime

Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2009 Anh Hai Trinh. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. This sieve is Eratosthenesque and only considers odd candidates. Print all primes <= n, where n := flag.Arg(0). If the flag -n is given, it will print the nth prime only. From https://github.com/aht/gosieve

Copyright 2009 Anh Hai Trinh. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. An efficient Eratosthenesque prime sieve using channels. This version uses wheel optimization and faster implementations of heap and sendproxy. Print all primes <= n, where n := flag.Arg(0). If the flag -n is given, it will print the nth prime only.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL