Skip to content

QuadraticInteger ​

A name from the enumeratio catalogue with no kernel of its own yet; this page carries its crosswalk only.

The element x+yωx + y\omega of QuadraticIntegers(d), held as a value.

QuadraticInteger(d, x, y)x+yωx + y\omega, with ω=(−1+d)/2\omega = (-1 + \sqrt d)/2 when d≡1(mod4)d \equiv 1 \pmod 4, else d\sqrt d
Typed signatures
TypePackageApplies
(integer | tuple<integer, integer, integer>, integer?, integer?) -> quadratic_integernumber-theoryalways

Domain: Number theory

Details
  • The carrier names its own ring, so a head reads it without Over: IsPrime(QuadraticInteger(-5, 1, 1)) asks about 1+−51 + \sqrt{-5} in Z[−5]\mathbb{Z}[\sqrt{-5}]
  • ω\omega is the ring's own generator, so x,yx, y are always integers: QuadraticInteger(-3, 0, 1) is ω=(−1+−3)/2=e2πi/3\omega = (-1 + \sqrt{-3})/2 = e^{2\pi i/3}
  • QuadraticInteger(-1, x, y) is GaussianInteger(x, y)

Examples

Basic #

1 + √−5 is irreducible but not prime

live ↗
InIsPrime(QuadraticInteger(−5,1,1))\mathrm{IsPrime}(\mathrm{QuadraticInteger}(-5, 1, 1))OutFalse\mathrm{False}

ω = (−1 + √−3)/2 is a unit

live ↗
InIsPrime(QuadraticInteger(−3,0,1))\mathrm{IsPrime}(\mathrm{QuadraticInteger}(-3, 0, 1))OutFalse\mathrm{False}

2 splits in ℤ[ω], ω = (−1 + √−7)/2

live ↗
InFactorInteger(QuadraticInteger(−7,4,0))\mathrm{FactorInteger}(\mathrm{QuadraticInteger}(-7, 4, 0))Out[(−71/22−12,2),(12+−72,2)]\bigl\lbrack(\frac{-7^{1/2}}{2}-\frac{1}{2},2), (\frac{1}{2}+\frac{\sqrt{-7}}{2},2)\bigr\rbrack
Scope #

QuadraticInteger(-1, x, y) is x + yi

live ↗
InIsPrime(QuadraticInteger(−1,2,1))\mathrm{IsPrime}(\mathrm{QuadraticInteger}(-1, 2, 1))OutTrue\mathrm{True}
About
Examples4

See also: QuadraticIntegers, GaussianInteger