Skip to content

A simple implementation to generate a list of primes using sieve of Eratosthenes

Notifications You must be signed in to change notification settings

phuclv90/Eratosthenes-Sieve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Eratosthenes-Sieve

A simple sieve of Eratosthenes implementation to generate a list of primes that are no larger than a specified upper limit.

The sieve will be stored as a vector of booleans. To save memory (and probably a little bit execution time) we'll only store odd numbers

Usage (with <limit> not less than 2):

Run the command as

./prime <limit> [breakat]

to print all primes up to <limit> with a line break after every [breakat] elements

By default breakat = 10. To print without any line breaks set breakat = 0

About

A simple implementation to generate a list of primes using sieve of Eratosthenes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages