Integers and Algorithms: Dr. Kahrobaei City Tech (CUNY)
Integers and Algorithms: Dr. Kahrobaei City Tech (CUNY)
Dr. Kahrobaei
City Tech (CUNY)
Representation of Integers
Theorem: Let b be a positive integer greater
than 1. Then if n is a positive integer, it can be
expressed uniquely in the form
n= ak bk + ak-1 bk-1 + + a1 b + a0
Where k is a nonegative integer, a0, a1, , ak are
nonnegative integers less than b, and ak 0.
Binary expansions
Choosing 2 as the base gives binary expansions
of integers. In binary notation each digit is either
a 0 or a 1.