That sounds right: quadratic to fill the array of multiples and then the loop over all the candidates to see if any occur within that list of multiples.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
79 Languages speed competition: Can we make Fortran win?
|
43 | 4318 | January 15, 2023 | |
Why is my code compiled with GFortran on Windows slower than on Ubuntu?
|
51 | 5760 | May 3, 2022 | |
Compile-time computation example now works with LFortran | 2 | 414 | June 4, 2024 | |
Compilation time vs. C++ | 22 | 1774 | January 10, 2022 | |
Tips to make this toy program faster? | 40 | 1879 | March 15, 2021 |