LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

primes

Generate prime numbers in a range

TLDR

Generate primes in range
$ primes [start] [stop]
copy
List primes up to 100
$ primes 2 100
copy
List primes from 1000 to 2000
$ primes 1000 2000
copy

SYNOPSIS

primes [start] [stop]

DESCRIPTION

primes generates and prints all prime numbers within a specified numeric range. Given a start and stop value, it outputs one prime per line, making it easy to pipe into other commands for counting, filtering, or further processing.This classic BSD utility is available on macOS natively and on Linux as part of the bsdgames package. It uses an efficient sieve algorithm for fast generation of primes even for large ranges.

PARAMETERS

START

Starting number.
STOP
Ending number.

INSTALL

sudo apt install libmath-prime-util-perl
copy

CAVEATS

BSD/macOS utility. Part of bsdgames on Linux.

HISTORY

primes is a classic BSD utility for prime number generation.

SEE ALSO

factor(1), bc(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid