14 #ifndef PROGS_SRC_COMMON_SIGMAODD_HARMONIC_HPP_ 15 #define PROGS_SRC_COMMON_SIGMAODD_HARMONIC_HPP_ 159 #endif // PROGS_SRC_COMMON_SIGMAODD_HARMONIC_HPP_ unsigned long nat_type
Type for natural number used in all code, on 64 bits.
Define type and some generic functions.
double harmonic_lower_bound(nat_type n)
Return a lower bound of H_n.
double diff_half_harmonic_upper_bound(nat_type a, nat_type b)
Return an upper bound of H_a - 1/2 H_b.
A lot of functions and stuffs to deal the sigma_odd problem and related stuffs.
nat_type sum_floor_n_harmonic_odd(nat_type n, nat_type to_n)
Return floor(n/1) + floor(n/3) + floor(n/5) + floor(n/7) + ... + (n/to_n or floor(1/(to_n-1))).
constexpr double harmonic_even(nat_type n)
Return 1/2 + 1/4 + 1/6 + 1/8 + ... + (1/n or 1/(n-1)).
constexpr double harmonic(nat_type n)
Return the harmonic number H_n = 1/1 + 1/2 + 1/3 + 1/4 + ... + 1/n.
double harmonic_upper_bound(nat_type n)
Return an upper bound of H_n.
constexpr double harmonic_odd(nat_type n)
Return 1/1 + 1/3 + 1/5 + 1/7 + ... + (1/n or 1/(n-1)).
const double euler_gamma
The Euler-Mascheroni constant 0.577215664901532860606512090082402431042... (rounded to an upper bound...
double diff_harmonic_upper_bound(nat_type a, nat_type b)
Return an upper bound of H_a - H_b.