Primes.jl
Primes.jl copied to clipboard
Prime numbers in Julia
Before `_primesmask(2^30)` took 2.726 seconds after it took `2.358s`. Although this is a relatively small improvement overall, it removes ~100% of the time for the small primes (250ms vs 30ms)...
Here is a example of two number theory functions made fast by `eachfactor` ``` """ `prime_residues(n)` the numbers less than `n` and prime to `n` julia> [prime_residues(24)] 1-element Vector{Vector{Int64}}: [1,...
Enhancement Request Add a function for the next nsmooth number as suggested [here](https://discourse.julialang.org/t/optimal-power-of-n-for-fftw/85232/2). Suggested code is given. Note I have never made a pull request, so am intimidated by the...
Today `primes([lo,] hi)` returns a collection, an iterator looks more suitable.
A very small issue: in the doc of `radical` it is rightly stated `radical(n::Integer)`. But in the source the function is `radical(n)` without any type restriction. It would be good...
idea comes from https://en.algorithmica.org/hpc/algorithms/factorization/. Lenstra will still be better for numbers larger than `Int64`, but getting extra speed is always nice.
Closes https://github.com/JuliaMath/Primes.jl/issues/45. I have this code lying around for a bit now, but never turned it into a PR. Now I'm turning it into a PR to force myself to...
This pull request sets up the CI workflow on this repository.
heavily inspired by @trizen, but refactored a little to make it more reliable.
At times, it is desirable to incorporate the default REPL output of factor(n) into strings for use, for example, within a println command. It would be nice to have a...