21 #ifndef PROGS_SRC_COMMON_SIGMAODD_PRIMES_HPP_ 22 #define PROGS_SRC_COMMON_SIGMAODD_PRIMES_HPP_ 61 constexpr
nat_type array_potential_prime_offsets_modulo_ = 210;
69 constexpr
unsigned int array_potential_prime_offsets_nb_ = 48;
85 constexpr
unsigned int array_odd_primes_nb_ = 14630843u - 1;
95 extern const nat_type array_potential_prime_offsets_[array_potential_prime_offsets_nb_];
130 std::vector<FactorExp>
239 potential_prime_offsets_table_by_index(
unsigned int i);
249 potential_prime_offsets_table_modulo();
259 potential_prime_offsets_table_nb();
283 #endif // PROGS_SRC_COMMON_SIGMAODD_PRIMES_HPP_ uint64_t nat_type
Type for natural number used in all code, on 64 bits.
prime_type odd_primes_table_last()
Return the last odd prime number in the precalculated table.
nat_type factorization_to_nu_odd(std::vector< FactorExp > prime_exps)
Return the number of odd divisors of the number corresponding to the factorization.
const std::string prime_filename
Default filename for the binary file "big_data/prime28.bin".
bool is_prime(nat_type n)
Return true iff n is a prime number.
uint32_t prime_type
Type for prime number, particularly for the table of primes.
bool read_primes_table()
Read the binary file prime_filename to fill the table with all primes < 2^28. This table must be read...
A lot of functions and stuffs to deal the sigma_odd problem and related stuffs.
bool is_prime_in_odd_primes_table(nat_type n)
Return true iff n is a prime number present in the precalculated table.
const prime_type * odd_primes_table_ptr()
Return a pointer to the first number in the precalculated table.
std::vector< FactorExp > factorize(nat_type n)
Return a list of prime factors with their exponents.
nat_type factorization_to_n(std::vector< FactorExp > prime_exps)
Return the number corresponding to the factorization.
prime_type odd_primes_table_by_index(unsigned int i)
Return the (i + 1)th odd prime number from the precalculated table.
nat_type factorization_to_sigma_odd(std::vector< FactorExp > prime_exps)
Return the sum of odd divisors of the number corresponding to the factorization.
nat_type factorization_to_sigma(std::vector< FactorExp > prime_exps)
Return the sum of all divisors of the number corresponding to the factorization.
constexpr unsigned int array_odd_primes_nb_
Number of odd prime numbers in the table array_odd_primes_.
constexpr unsigned int odd_primes_table_nb()
Return the number of odd prime numbers in the precalculated table.
nat_type factorization_to_nu(std::vector< FactorExp > prime_exps)
Return the number of all divisors of the number corresponding to the factorization.
Functions in link with divisor notion: sum of divisors, factorization, GCD, coprime, ...
prime_type * array_odd_primes_
Array of all odd prime numbers < 2^28 with a final 0. (Or < 2^16 if the macro PRIME16 is defined...