Function ladderz::pre_algebra::get_prime_factorization
source · pub fn get_prime_factorization(n: u32) -> HashMap<u32, u32>Expand description
Write a program that determines the prime factorization of a positive integer n.
Function ladderz::pre_algebra::get_prime_factorization
source · pub fn get_prime_factorization(n: u32) -> HashMap<u32, u32>Expand description
Returns the prime factorization of a positive integer n.
For example the prime factorization of 12 is 22 * 31, and the output is a HashMap of the form
[(2, 2), (3, 1)] where the first element of each tuple is the prime factor and the second element is the exponent.
Examples
diff --git a/ladderz/pre_algebra/fn.get_primes_in_range.html b/ladderz/pre_algebra/fn.get_primes_in_range.html index 6e9014c..d2c18ad 100644 --- a/ladderz/pre_algebra/fn.get_primes_in_range.html +++ b/ladderz/pre_algebra/fn.get_primes_in_range.html @@ -1,4 +1,4 @@ -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.
+Function ladderz::pre_algebra::get_primes_in_range
source · pub fn get_primes_in_range(start: u32, end: u32) -> HashSet<u32>Expand description
Returns all prime numbers in the range [start, end].
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 6d34773..dbb1d41 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 in the range [start, end] within the natural numbers.
- 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.
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]). - Returns the prime factorization of a positive integer
n. - Returns all prime numbers in the range [start, end].
- 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.
n.","Finds all factors of a positive integer n.","Finds all the multiples of a positive integer n up to and …","Write a program that determines the prime factorization of …","Write a program that finds all prime numbers in the range […","Checks if a positive integer n is a composite number.","Checks if a positive integer x is a factor of another …","Checks if a positive integer x is a multiple of another …","Checks if a positive integer n is a prime number."],"i":[0,0,0,0,0,0,0,0,0,0],"f":[0,[1,2],[1,[[2,[1]]]],[[1,1],[[2,[1]]]],[1,[[3,[1,1]]]],[[1,1],[[2,[1]]]],[1,4],[[1,1],4],[[1,1],4],[1,4]],"c":[],"p":[[15,"u32"],[3,"HashSet"],[3,"HashMap"],[15,"bool"]]}\
+"ladderz":{"doc":"ladderz","t":"AFFFFFFFFF","n":["pre_algebra","get_factor_pairs","get_factors","get_multiples_in_range","get_prime_factorization","get_primes_in_range","is_composite","is_factor","is_multiple","is_prime"],"q":[[0,"ladderz"],[1,"ladderz::pre_algebra"]],"d":["Various pre-algebra implementations including factor …","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 n up to and …","Returns the prime factorization of a positive integer n.","Returns all prime numbers in the range [start, end].","Checks if a positive integer n is a composite number.","Checks if a positive integer x is a factor of another …","Checks if a positive integer x is a multiple of another …","Checks if a positive integer n is a prime number."],"i":[0,0,0,0,0,0,0,0,0,0],"f":[0,[1,2],[1,[[2,[1]]]],[[1,1],[[2,[1]]]],[1,[[3,[1,1]]]],[[1,1],[[2,[1]]]],[1,4],[[1,1],4],[[1,1],4],[1,4]],"c":[],"p":[[15,"u32"],[3,"HashSet"],[3,"HashMap"],[15,"bool"]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/src/ladderz/pre_algebra/unit1.rs.html b/src/ladderz/pre_algebra/unit1.rs.html
index a12b32c..d134176 100644
--- a/src/ladderz/pre_algebra/unit1.rs.html
+++ b/src/ladderz/pre_algebra/unit1.rs.html
@@ -575,7 +575,7 @@
false
}
-/// Write a program that finds all prime numbers in the range [start, end] within the natural numbers.
+/// Returns all prime numbers in the range [start, end].
///
/// A prime number is a positive integer greater than 1 that is
/// not evenly divisible by any positive integer other than 1 and itself.
@@ -601,7 +601,7 @@
primes
}
-/// Write a program that determines the prime factorization of a positive integer `n`.
+/// Returns the prime factorization of a positive integer `n`.
///
/// For example the prime factorization of 12 is 2<sup>2</sup> * 3<sup>1</sup>, and the output is a HashMap of the form
/// `[(2, 2), (3, 1)]` where the first element of each tuple is the prime factor and the second element is the exponent.