Library of Math
Online Math Organized by Subject Into Topics
Subscribe to the Library of Math Feed
PRINT LINKED RELATED

Integer Arithmetic

(1) Definition (Equivalence Relation) A relation integer arithmetic _gr_1.gif] on a non-empty set integer arithmetic _gr_2.gif] is an equivalence relation on integer arithmetic _gr_3.gif] if it satisfies the following three properties:

    (i) (Reflexive) If integer arithmetic _gr_4.gif] then integer arithmetic _gr_5.gif]
    
    (ii) (Symmetric) If integer arithmetic _gr_6.gif] and integer arithmetic _gr_7.gif] then integer arithmetic _gr_8.gif]
    
    (iii) (Transitive) If integer arithmetic _gr_9.gif] integer arithmetic _gr_10.gif] and integer arithmetic _gr_11.gif] then integer arithmetic _gr_12.gif]
    

(2) Definition (Congruent Modulo n) Let integer arithmetic _gr_13.gif] be a positive integer. Integers integer arithmetic _gr_14.gif] and integer arithmetic _gr_15.gif] are congruent modulo n if integer arithmetic _gr_16.gif] is divisible by integer arithmetic _gr_17.gif] and is denoted by integer arithmetic _gr_18.gif]

(3) Example (Congruent Modulo n) We have integer arithmetic _gr_19.gif] since integer arithmetic _gr_20.gif] but   integer arithmetic _gr_21.gif] since integer arithmetic _gr_22.gif] Also we have integer arithmetic _gr_23.gif] since integer arithmetic _gr_24.gif] and integer arithmetic _gr_25.gif] since integer arithmetic _gr_26.gif] integer arithmetic _gr_27.gif]

(4) Proposition (Congruence Modulo n) Congruence modulo integer arithmetic _gr_28.gif] is an equivalence relation on the set of integers for each positive integer integer arithmetic _gr_29.gif]

    Proof. If integer arithmetic _gr_30.gif] is an integer, then integer arithmetic _gr_31.gif] since integer arithmetic _gr_32.gif] and so integer arithmetic _gr_33.gif] is reflexive. If integer arithmetic _gr_34.gif] and integer arithmetic _gr_35.gif] are integers and integer arithmetic _gr_36.gif] then integer arithmetic _gr_37.gif] since integer arithmetic _gr_38.gif] integer arithmetic _gr_39.gif] integer arithmetic _gr_40.gif] and so integer arithmetic _gr_41.gif] is symmetric. If integer arithmetic _gr_42.gif] and integer arithmetic _gr_43.gif] are integers, integer arithmetic _gr_44.gif] and integer arithmetic _gr_45.gif] then integer arithmetic _gr_46.gif] because integer arithmetic _gr_47.gif] and integer arithmetic _gr_48.gif] implies integer arithmetic _gr_49.gif] and so integer arithmetic _gr_50.gif] is transitive. integer arithmetic _gr_51.gif]

(5) Proposition (Congruence and the Integers) If integer arithmetic _gr_52.gif] and integer arithmetic _gr_53.gif] are integers, then integer arithmetic _gr_54.gif] if and only if there exists an integer integer arithmetic _gr_55.gif] such that integer arithmetic _gr_56.gif]
    
    Proof. integer arithmetic _gr_57.gif]If integer arithmetic _gr_58.gif] then integer arithmetic _gr_59.gif] and this means there exists an integer integer arithmetic _gr_60.gif] such that integer arithmetic _gr_61.gif] and so integer arithmetic _gr_62.gif] Conversely, if there is an integer integer arithmetic _gr_63.gif] such that integer arithmetic _gr_64.gif] then integer arithmetic _gr_65.gif] and so integer arithmetic _gr_66.gif] integer arithmetic _gr_67.gif]

(6) Proposition (Properties of Congruence Modulo n) Let integer arithmetic _gr_68.gif] be an integer. Then the following hold for all integers integer arithmetic _gr_69.gif]

    (i) If integer arithmetic _gr_70.gif] and integer arithmetic _gr_71.gif] then integer arithmetic _gr_72.gif] and integer arithmetic _gr_73.gif]
    
    (ii) If integer arithmetic _gr_74.gif] then integer arithmetic _gr_75.gif]
    
    (iii) If integer arithmetic _gr_76.gif] and integer arithmetic _gr_77.gif] then integer arithmetic _gr_78.gif]
    
    (iv) There exists an integer integer arithmetic _gr_79.gif] such that integer arithmetic _gr_80.gif] if and only if integer arithmetic _gr_81.gif]
    
    (v) If integer arithmetic _gr_82.gif] then integer arithmetic _gr_83.gif]
    
    Proof. (i) If integer arithmetic _gr_84.gif] and integer arithmetic _gr_85.gif] then integer arithmetic _gr_86.gif] and integer arithmetic _gr_87.gif] It follows that, integer arithmetic _gr_88.gif] and thus   integer arithmetic _gr_89.gif] It also follows that, integer arithmetic _gr_90.gif] and integer arithmetic _gr_91.gif] thus integer arithmetic _gr_92.gif] Therefore,   integer arithmetic _gr_93.gif]
    (ii) If integer arithmetic _gr_94.gif] then integer arithmetic _gr_95.gif] and so integer arithmetic _gr_96.gif] which means integer arithmetic _gr_97.gif]
    (iii) If integer arithmetic _gr_98.gif] then integer arithmetic _gr_99.gif] which means integer arithmetic _gr_100.gif] Since integer arithmetic _gr_101.gif] it follow that integer arithmetic _gr_102.gif] and so   integer arithmetic _gr_103.gif]
    
(iv) If integer arithmetic _gr_104.gif] then there exists integers integer arithmetic _gr_105.gif] and integer arithmetic _gr_106.gif] such that integer arithmetic _gr_107.gif] Let integer arithmetic _gr_108.gif] then integer arithmetic _gr_109.gif] as desired. Conversely, if there is such a integer arithmetic _gr_110.gif] then integer arithmetic _gr_111.gif] for some integer arithmetic _gr_112.gif] Thus, integer arithmetic _gr_113.gif] and so integer arithmetic _gr_114.gif]
    (v) If integer arithmetic _gr_115.gif] we know that integer arithmetic _gr_116.gif] Thus there exists an integer integer arithmetic _gr_117.gif] such that integer arithmetic _gr_118.gif] and dividing both sides by integer arithmetic _gr_119.gif] we have integer arithmetic _gr_120.gif] Because integer arithmetic _gr_121.gif] it follows that integer arithmetic _gr_122.gif] Therefore, integer arithmetic _gr_123.gif] integer arithmetic _gr_124.gif]

(7) Example (Properties of Congruence Modulo n)
    (a)
The remainder of integer arithmetic _gr_125.gif] when divided by 9 is the same as the remainder of the sum of its digits when divided by 9 which follows from writing integer arithmetic _gr_126.gif] where integer arithmetic _gr_127.gif] by noting that integer arithmetic _gr_128.gif] for any integer arithmetic _gr_129.gif]
    (b) The remainder of integer arithmetic _gr_130.gif] when divided by 11 is the same as the remainder of the alternating sum of its digits when divided by 11 which follows from writing integer arithmetic _gr_131.gif] in decimal form and noting that integer arithmetic _gr_132.gif] for any integer arithmetic _gr_133.gif]
    (c) If integer arithmetic _gr_134.gif] is a prime number, then integer arithmetic _gr_135.gif] which follows from the binomial theorem:  

integer arithmetic _gr_136.gif]
                
because integer arithmetic _gr_137.gif] for integer arithmetic _gr_138.gif] integer arithmetic _gr_139.gif]

(8) Proposition (Equivalence Classes for the Integers) Let integer arithmetic _gr_140.gif] be a positive integer. Then a complete set of equivalence class representatives on integer arithmetic _gr_141.gif] for congruence modulo integer arithmetic _gr_142.gif] is integer arithmetic _gr_143.gif]

    Proof. Given an integer integer arithmetic _gr_144.gif] the Division Algorithm yields unique integers integer arithmetic _gr_145.gif] and integer arithmetic _gr_146.gif] such that integer arithmetic _gr_147.gif] and integer arithmetic _gr_148.gif] Then integer arithmetic _gr_149.gif] and so integer arithmetic _gr_150.gif] is congruent to at least one of integer arithmetic _gr_151.gif] In fact integer arithmetic _gr_152.gif] is unique because otherwise, say integer arithmetic _gr_153.gif] and   integer arithmetic _gr_154.gif] with integer arithmetic _gr_155.gif] for some integer arithmetic _gr_156.gif] would contradict the uniqueness of the Division Algorithm. integer arithmetic _gr_157.gif]

(9) Definition (Modular Arithmetic) Let   integer arithmetic _gr_158.gif] be a complete set of equivalence class representatives on integer arithmetic _gr_159.gif] for congruence modulo integer arithmetic _gr_160.gif] then integer arithmetic _gr_161.gif] and define the operation integer arithmetic _gr_162.gif] on integer arithmetic _gr_163.gif] by integer arithmetic _gr_164.gif] Arithmetic using this operation is often referred to as modular arithmetic.

    The operation integer arithmetic _gr_165.gif] integer arithmetic _gr_166.gif] is a well-defined binary operation; meaning, if integer arithmetic _gr_167.gif] and integer arithmetic _gr_168.gif] in integer arithmetic _gr_169.gif] then  

integer arithmetic _gr_170.gif]

which follows from

integer arithmetic _gr_171.gif]

(10) Proposition (Modular Arithmetic) Let integer arithmetic _gr_172.gif] be a positive integer, then integer arithmetic _gr_173.gif] is associative and commutative, each element has an inverse, and integer arithmetic _gr_174.gif] is the identity element.

    Proof. By the definition of integer arithmetic _gr_175.gif] and the use of associativity in the integers, it follows that integer arithmetic _gr_176.gif] integer arithmetic _gr_177.gif] integer arithmetic _gr_178.gif] integer arithmetic _gr_179.gif] integer arithmetic _gr_180.gif] integer arithmetic _gr_181.gif] for any integer arithmetic _gr_182.gif] integer arithmetic _gr_183.gif]  and integer arithmetic _gr_184.gif] The element integer arithmetic _gr_185.gif] is the identity because integer arithmetic _gr_186.gif] integer arithmetic _gr_187.gif] integer arithmetic _gr_188.gif] for any integer arithmetic _gr_189.gif] For every element integer arithmetic _gr_190.gif] of integer arithmetic _gr_191.gif] there is an inverse because integer arithmetic _gr_192.gif] integer arithmetic _gr_193.gif] integer arithmetic _gr_194.gif] and indeed integer arithmetic _gr_195.gif]  Commutativity follows since integer arithmetic _gr_196.gif] integer arithmetic _gr_197.gif] integer arithmetic _gr_198.gif] integer arithmetic _gr_199.gif] for integer arithmetic _gr_200.gif] integer arithmetic _gr_201.gif] integer arithmetic _gr_202.gif]

(11) Example (Modular Arithmetic) The arithmetic table for integer arithmetic _gr_203.gif] is:

integer arithmetic _gr_204.gif]

integer arithmetic _gr_205.gif]

(12) Proposition (Modular Exponentiation) If integer arithmetic _gr_206.gif] and integer arithmetic _gr_207.gif] then integer arithmetic _gr_208.gif]

    Proof. Because integer arithmetic _gr_209.gif] we have by definition, integer arithmetic _gr_210.gif] and since
    
integer arithmetic _gr_211.gif]

we see that integer arithmetic _gr_212.gif] whence integer arithmetic _gr_213.gif] Therefore, integer arithmetic _gr_214.gif] integer arithmetic _gr_215.gif]

    This topic describes how to solve a linear congruence equation, details when a solution exists, and in such case, exactly how many solutions will occur. Then inverse are covered, that is finding a multiplicative inverse of a given integer and moduli is defined and illustrated.

(13) Definition (Linear Congruence) Given integers integer arithmetic _gr_216.gif] and a modulus integer arithmetic _gr_217.gif] a congruence equation of the form integer arithmetic _gr_218.gif] is called a linear congruence where integer arithmetic _gr_219.gif] is an unknown.

(14) Example (Solutions of a Linear Congruence) Suppose integer arithmetic _gr_220.gif] is a solution of the congruence integer arithmetic _gr_221.gif] Then there exists an integer integer arithmetic _gr_222.gif] such that integer arithmetic _gr_223.gif] Thus, integer arithmetic _gr_224.gif] so that integer arithmetic _gr_225.gif] is a solution of the linear Diophantine equation integer arithmetic _gr_226.gif] Conversely, if the linear Diophantine equation integer arithmetic _gr_227.gif] has a solution integer arithmetic _gr_228.gif] then integer arithmetic _gr_229.gif] and so integer arithmetic _gr_230.gif] Thus, the linear congruence integer arithmetic _gr_231.gif] has integer arithmetic _gr_232.gif] as a solution if and only if there is an integer integer arithmetic _gr_233.gif] such that integer arithmetic _gr_234.gif] is a solution of the linear Diophantine equation integer arithmetic _gr_235.gif] integer arithmetic _gr_236.gif]

(15) Proposition (Linear Congruence) Let integer arithmetic _gr_237.gif] be an unknown in the linear congruence equation integer arithmetic _gr_238.gif] and integer arithmetic _gr_239.gif]

    (i) If integer arithmetic _gr_240.gif] then there is precisely one solution.
    
    (ii) If integer arithmetic _gr_241.gif] then the congruence has no solution.
    
    (iii) If integer arithmetic _gr_242.gif] then there are exactly integer arithmetic _gr_243.gif] distinct solutions.
    
    Proof. (i) By the Euclidean algorithm there are integers integer arithmetic _gr_244.gif] and integer arithmetic _gr_245.gif] such that integer arithmetic _gr_246.gif] and then integer arithmetic _gr_247.gif] and thus we find that integer arithmetic _gr_248.gif] is a solution of the congruence. If integer arithmetic _gr_249.gif] is any other solution, then integer arithmetic _gr_250.gif] Thus, integer arithmetic _gr_251.gif] and since integer arithmetic _gr_252.gif] we have integer arithmetic _gr_253.gif]
    (ii)-(iii) Since the congruence is equivalent to integer arithmetic _gr_254.gif] in integers integer arithmetic _gr_255.gif] and integer arithmetic _gr_256.gif] the existence of solutions integer arithmetic _gr_257.gif] and integer arithmetic _gr_258.gif] requires that integer arithmetic _gr_259.gif] divide integer arithmetic _gr_260.gif] Suppose then that this requirement is satisfied and let integer arithmetic _gr_261.gif] and integer arithmetic _gr_262.gif] where integer arithmetic _gr_263.gif] and integer arithmetic _gr_264.gif] is a particular solution, be all solutions to integer arithmetic _gr_265.gif] Therefore, for any integer integer arithmetic _gr_266.gif] integer arithmetic _gr_267.gif] is a solution to integer arithmetic _gr_268.gif]
    To determine that there are integer arithmetic _gr_269.gif] incongruent solutions, we find the condition that describes when two solutions are congruent modulo integer arithmetic _gr_270.gif] Suppose we have two solutions, namely,

integer arithmetic _gr_271.gif].

Since integer arithmetic _gr_272.gif] it follows that integer arithmetic _gr_273.gif] This show that a complete set of incongruent solutions is obtained by taking integer arithmetic _gr_274.gif] and integer arithmetic _gr_275.gif] ranges through a complete system of residues modulo integer arithmetic _gr_276.gif] one such set is given by integer arithmetic _gr_277.gif] integer arithmetic _gr_278.gif]

(16) Example (Linear Congruence) Solve the linear congruence integer arithmetic _gr_279.gif]

    Solution. Solving the linear congruence equation is equivalent to solving the linear Diophantine equation integer arithmetic _gr_280.gif] for integer arithmetic _gr_281.gif] and integer arithmetic _gr_282.gif] There is a solution because integer arithmetic _gr_283.gif] and it is unique modulo integer arithmetic _gr_284.gif] A particular solution is integer arithmetic _gr_285.gif] and integer arithmetic _gr_286.gif] Thus all solutions to the Diophantine equations are integer arithmetic _gr_287.gif] and integer arithmetic _gr_288.gif] Suppose that

integer arithmetic _gr_289.gif]

are two solutions to the congruence equation. Then clearly, integer arithmetic _gr_290.gif] This show that a complete set of incongruent solutions is obtained by taking integer arithmetic _gr_291.gif] and integer arithmetic _gr_292.gif] integer arithmetic _gr_293.gif]

(17) Example (Linear Congruence) Solve the linear congruence integer arithmetic _gr_294.gif]

    Solution. Solving the linear congruence equation is equivalent to solving the linear Diophantine equation integer arithmetic _gr_295.gif] for integer arithmetic _gr_296.gif] and integer arithmetic _gr_297.gif] There is a solution because integer arithmetic _gr_298.gif] and integer arithmetic _gr_299.gif] and so there are exactly two solutions modulo integer arithmetic _gr_300.gif] A particular solution is integer arithmetic _gr_301.gif] and integer arithmetic _gr_302.gif] Thus all solutions for integer arithmetic _gr_303.gif] are integer arithmetic _gr_304.gif] and integer arithmetic _gr_305.gif] Suppose that

integer arithmetic _gr_306.gif]

are two solutions. Since integer arithmetic _gr_307.gif] we have, integer arithmetic _gr_308.gif] This show that a complete set of incongruent solutions is obtained by taking integer arithmetic _gr_309.gif] and integer arithmetic _gr_310.gif] where integer arithmetic _gr_311.gif] Therefore, the solutions are integer arithmetic _gr_312.gif] and integer arithmetic _gr_313.gif]   integer arithmetic _gr_314.gif]
    
(18) Example (Linear Congruence) Solve the linear congruence integer arithmetic _gr_315.gif]

    Solution. Because integer arithmetic _gr_316.gif] there are integer arithmetic _gr_317.gif] incongruent solutions modulo integer arithmetic _gr_318.gif] We use cancellation to simplify the congruence to integer arithmetic _gr_319.gif] We have integer arithmetic _gr_320.gif] Therefore, in terms of the original modulus, the solution is

integer arithmetic _gr_321.gif]
integer arithmetic _gr_322.gif]

(19) Example (Linear Congruence) Solve the linear congruence integer arithmetic _gr_323.gif]

    Solution.  No solution because integer arithmetic _gr_324.gif] does not divide integer arithmetic _gr_325.gif]   integer arithmetic _gr_326.gif]
    
(20) Example (Linear Congruence) Solve the linear congruence integer arithmetic _gr_327.gif]

    Solution. Because integer arithmetic _gr_328.gif] there is a unique solution modulo 77. We have integer arithmetic _gr_329.gif] and dividing by integer arithmetic _gr_330.gif] we have integer arithmetic _gr_331.gif] Next multiplying by integer arithmetic _gr_332.gif] we have integer arithmetic _gr_333.gif] and so integer arithmetic _gr_334.gif] Therefore, integer arithmetic _gr_335.gif] integer arithmetic _gr_336.gif]

(21) Definition (Inverse of a Modulo n) Let integer arithmetic _gr_337.gif] be an integer with integer arithmetic _gr_338.gif] Then a solution of the linear congruence integer arithmetic _gr_339.gif] is called an inverse of integer arithmetic _gr_340.gif]

(22) Proposition (Inverse of a Modulo n) Let integer arithmetic _gr_341.gif] be a prime. The positive integer integer arithmetic _gr_342.gif] is its own inverse modulo integer arithmetic _gr_343.gif] if and only if integer arithmetic _gr_344.gif] or integer arithmetic _gr_345.gif]

    Proof. If integer arithmetic _gr_346.gif] is its own inverse modulo integer arithmetic _gr_347.gif] then integer arithmetic _gr_348.gif] Thus, integer arithmetic _gr_349.gif] and so either integer arithmetic _gr_350.gif] or integer arithmetic _gr_351.gif] Therefore, integer arithmetic _gr_352.gif] or integer arithmetic _gr_353.gif] Conversely, if integer arithmetic _gr_354.gif] or integer arithmetic _gr_355.gif] then integer arithmetic _gr_356.gif] so that integer arithmetic _gr_357.gif] is its own inverse modulo integer arithmetic _gr_358.gif] integer arithmetic _gr_359.gif]

(23) Example (Inverse of a Modulo n) By finding the inverse of 37 modulo integer arithmetic _gr_360.gif] solve integer arithmetic _gr_361.gif] for any integer integer arithmetic _gr_362.gif]  

    Solution. First we solve, integer arithmetic _gr_363.gif] We have

integer arithmetic _gr_364.gif]

Now dividing by integer arithmetic _gr_365.gif] and simplifying, we have

integer arithmetic _gr_366.gif]

Again dividing by integer arithmetic _gr_367.gif] and simplifying, we have

integer arithmetic _gr_368.gif]

Therefore, integer arithmetic _gr_369.gif] Now to solve integer arithmetic _gr_370.gif] we multiply by integer arithmetic _gr_371.gif] and we have integer arithmetic _gr_372.gif] Thus integer arithmetic _gr_373.gif] is the solution. integer arithmetic _gr_374.gif]

Cite this as:
Integer Arithmetic
Published by Library of Math -- Online math organized by subject into topics.
Written by Smith, David A.
http://www.libraryofmath.com/integer-arithmetic.html
about us contact us privacy policy terms of use mision statement lom help
The Library of Math - Online Math Organized by Subject Into Topics. © 2005 - 2009 www.LibraryOfMath.com All rights reserved. math rss