Math 2.0

Number theory Definition

Modulo operation

Builds on Division algorithm

Definition

Let aa and nn be integers with n≠0n \neq 0. The integer a mod na \bmod n is the remainder rr of the division of aa by nn. Thus a mod na \bmod n is the unique integer rr such that 0≤r<∣n∣0 \le r < |n| and a−ra - r is a multiple of nn.

Remarks

For example, 17 mod 5=217 \bmod 5 = 2 and (−17) mod 5=3(-17) \bmod 5 = 3. Many programming languages use a different convention. In them, the remainder has the sign of aa, so the result for −17-17 and 55 is −2-2. The Lean library Mathlib sets a mod 0=aa \bmod 0 = a.

Reading path

To understand this page from the ground up, read these 3 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Divisibility definition
  2. Division algorithm statement
  3. Modulo operation definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Modulo, Variants of the definition
About this page
Tag04FHQSJCQ5
URIm2://04FHQSJCQ5
Aliasesmod, remainder
Kinddefinition
WritingW1 stated
MSC11A07
DefinesModulo operation
UsesDivision algorithm

Markdown · JSON · Edit on GitHub

What this page needs for W2

  • edge instance_of in: one example (0 of 1)
  • edge not_instance_of in: one non-example that fails one clause (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.