8 #ifndef PROGS_SRC_COMMON_SIGMAODD_DIVISORS__INLINE_HPP_ 9 #define PROGS_SRC_COMMON_SIGMAODD_DIVISORS__INLINE_HPP_ 67 return (
gcd(a, b) == 1);
136 return n >> (
static_cast<unsigned int>(ffsl(static_cast<long int>(n))) - 1);
141 std::pair<nat_type, unsigned int>
146 const unsigned int alpha =
static_cast<unsigned int>(ffsl(static_cast<long int>(n))) - 1;
148 return std::make_pair(n >> alpha, alpha);
153 #endif // PROGS_SRC_COMMON_SIGMAODD_DIVISORS__INLINE_HPP_ uint64_t nat_type
Type for natural number used in all code, on 64 bits.
Structure to represent a factor with its exponent.
constexpr bool is_unitary_divide(nat_type d, nat_type n)
Return true iff (d divide n) and (d NOT divide n/d).
std::pair< nat_type, unsigned int > divide_until_odd_nb(nat_type n)
Divide n by 2 until the result is odd, and return (result, number of divisions).
nat_type divide_until_odd(nat_type n)
Return n divided by 2 until the result is odd.
bool is_square(nat_type n)
Return true iff n is a perfect square.
A lot of functions and stuffs to deal the sigma_odd problem and related stuffs.
constexpr bool is_mersenne_prime_unitary_divide(nat_type n)
Return true iff at least one of 3, 7, 31, 127, 8191, 131071, 524287, 2147483647 or 230584300921369395...
constexpr bool is_divide(nat_type d, nat_type n)
Return true iff d divide n, i.e. if n is divisible by d.
constexpr nat_type pow_nat(nat_type n, unsigned int k)
Return x^k, x power k.
constexpr bool operator==(const FactorExp &other) const
constexpr nat_type gcd(nat_type a, nat_type b)
Return the Greatest Common Divisor of a and b.
constexpr bool is_first_mersenne_prime_unitary_divide_or_square(nat_type n)
Return true iff is_first_mersenne_prime_unitary_divide(n) or is_square(n).
constexpr bool is_little_mersenne_prime_unitary_divide(nat_type n)
Return true iff at least one of 3, 7, 31, 127, 8191, 131071 or 524287 is an unitary divisor of n...
constexpr bool is_first_mersenne_prime_unitary_divide(nat_type n)
Return true iff at least one of 3, 7, 31 or 127 is an unitary divisor of n.
constexpr nat_type value() const
constexpr nat_type is_coprime(nat_type a, nat_type b)
Return true iff a and b are coprime (relatively prime).