Function ladderz::pre_algebra::get_primes_in_range
source · pub fn get_primes_in_range(start: u32, n: u32) -> HashSet<u32>Expand description
Write a program that finds all prime numbers of a positive integer n in the range [start, n].
Function ladderz::pre_algebra::get_primes_in_range
source · pub fn get_primes_in_range(start: u32, end: u32) -> HashSet<u32>Expand description
Write a program that finds all prime numbers in the range [start, end] within the natural numbers.
A prime number is a positive integer greater than 1 that is not evenly divisible by any positive integer other than 1 and itself.
Examples
diff --git a/ladderz/pre_algebra/index.html b/ladderz/pre_algebra/index.html index c88fdc8..6d34773 100644 --- a/ladderz/pre_algebra/index.html +++ b/ladderz/pre_algebra/index.html @@ -5,4 +5,4 @@ let x: u32 = 10; println!("The factors of {x} are {:?}.", get_factors(x));The factors of 10 are {1, 5, 2, 10}.
-Functions
- Finds all factor pairs for a positive integer
n. - Finds all factors of a positive integer
n. - Finds all the multiples of a positive integer
nup to and includingend(in the range [n, end]). - Write a program that determines the prime factorization of a positive integer
n. - Write a program that finds all prime numbers of a positive integer
nin the range [start, n]. - Checks if a positive integer
nis a composite number. - Checks if a positive integer
xis a factor of another positive integery. - Checks if a positive integer
xis a multiple of another positive integery. - Checks if a positive integer
nis a prime number.