Copyright | Copyright (C) 2021 Yoo Chung |
---|---|

License | GPL-3.0-or-later |

Maintainer | dev@chungyc.org |

Safe Haskell | Safe-Inferred |

Language | GHC2021 |

These functions were written in support of specific arithmetic problems, but which turn out to be useful for other problems as well.

# Documentation

dividesBy :: Integral a => a -> a -> Bool Source #

Whether the first argument divides by the second argument.

Initially written to support Problems.P31.

primes :: Integral a => [a] Source #

List of all prime numbers.

Computed with an Erastothenes sieve. Unlike the classic sieve, which strikes out multiples of prime numbers from subsequent numbers, checks the primality of each integer against the prime numbers already determined.

Initially written to support Problems.P31.

gaussianUnits :: [Complex Integer] Source #

List of Gaussian integer units. I.e., \(1\), \(i\), \(-1\), and \(-i\).