arithmoi-0.7.0.0: Efficient basic number-theoretic functions.

Copyright(c) 2011 Daniel Fischer 2017 Andrew Lelechenko
LicenseMIT
MaintainerAndrew Lelechenko <andrew.lelechenko@gmail.com>
StabilityProvisional
PortabilityNon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Moduli.Jacobi

Description

Jacobi symbol.

Synopsis

Documentation

jacobi :: (Integral a, Bits a) => a -> a -> JacobiSymbol Source #

Jacobi symbol of two numbers. The "denominator" must be odd and positive, this condition is checked.

If both numbers have a common prime factor, the result is 0, otherwise it is ±1.

jacobi' :: (Integral a, Bits a) => a -> a -> JacobiSymbol Source #

Jacobi symbol of two numbers without validity check of the "denominator".