From 5d5c0141d160df9157b538a332232d4cd59769a1 Mon Sep 17 00:00:00 2001 From: rzmk Date: Wed, 11 Oct 2023 22:02:51 +0000 Subject: [PATCH] deploy: 065c233986e5513c91a95ee1fa22a4c40e0a2100 --- ladderz/pre_algebra/fn.get_primes_in_range.html | 2 +- ladderz/pre_algebra/index.html | 2 +- search-index.js | 2 +- src/ladderz/pre_algebra/unit1.rs.html | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ladderz/pre_algebra/fn.get_primes_in_range.html b/ladderz/pre_algebra/fn.get_primes_in_range.html index 1e05912..6e9014c 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 @@ -get_primes_in_range in ladderz::pre_algebra - Rust
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].

+get_primes_in_range in ladderz::pre_algebra - Rust
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 n up to and including end (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 n in the range [start, n].
  • Checks if a positive integer n is a composite number.
  • Checks if a positive integer x is a factor of another positive integer y.
  • Checks if a positive integer x is a multiple of another positive integer y.
  • Checks if a positive integer n is a prime number.
\ No newline at end of file +

Functions

\ No newline at end of file diff --git a/search-index.js b/search-index.js index f458030..6f0b4a2 100644 --- a/search-index.js +++ b/search-index.js @@ -1,5 +1,5 @@ var searchIndex = JSON.parse('{\ -"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 …","Write a program that determines the prime factorization of …","Write a program that finds all prime numbers of a positive …","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 …","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"]]}\ }'); 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 77f00f0..a12b32c 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 of a positive integer `n` in the range [start, n]. +/// 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. @@ -590,10 +590,10 @@ /// let expected: HashSet<u32> = [2, 3, 5, 7].into(); /// assert_eq!(result, expected); /// ``` -pub fn get_primes_in_range(start: u32, n: u32) -> HashSet<u32> { +pub fn get_primes_in_range(start: u32, end: u32) -> HashSet<u32> { let mut primes: HashSet<u32> = HashSet::new(); - for num in start..n + 1 { + for num in start..end + 1 { if is_prime(num) { primes.insert(num); }