18 template<std::
integral T>
37 template<std::
integral T>
40 return sizeof(T) << 3;
59 std::vector<bool> prime(n + 1,
true);
60 prime[0] = prime[1] =
false;
63 std::vector<int> primes;
68 for (
int p = 2; p <= std::sqrt(n); ++p) {
73 for (
int i = p * p; i <= n; i += p) {
81 for (
int p = 2; p <= n; ++p) {
101 constexpr std::array<std::int32_t, 46341> arr = []()
constexpr {
102 std::array<std::int32_t, 46341> _arr = {};
103 for (
int i = 0; i < 46341; ++i) {
109 return std::binary_search(arr.begin(), arr.end(), num);
Definition big_integer.hpp:14
int numDigits(T num)
Definition number_utils.hpp:19
static std::vector< int > SieveOfEratosthenes(int n)
Definition number_utils.hpp:56
static bool isPerfectSquare(std::int32_t num)
Definition number_utils.hpp:97
int numBits(T num)
Definition number_utils.hpp:38