Allows you to input a number, n
, and prints out a multiplication table with
n
prime numbers.
Ensure you have Elixir installed.
Run the following commands, where n
is a positive integer.
git clone https://github.com/katbow/primes-test.git
cd primes-test
iex -S mix
Primes.make_primes_mult_table(n)
Tests can be run with mix test
when in the primes-test
directory.
I was pleased with the process I took while completing the problem. If I was unsure of where to go next, I would take time to either branch off & "hack" then delete the branch, or I would re-examine the Sieve I was attempting to use for better understanding.
- Improve on the speed of the algorithm.
- I was going about the
remove_multiples/4
function the wrong way because it is iterating over numbers that are already crossed off by previous prime numbers, and because I (attempt to) delete an item from the list on each step, which is an expensive operation.
- I was going about the