Algebra
I am going to assume that you are already aware of the topics in this lesson. However, I will go over them briefly to brush up and as a reference if and when you need them.
We'll cover the following
Natural numbers
All positive integers starting from
Sum
Sum of first natural numbers is
Factorial
Denoted by the exclamation mark symbol.
n!
is called n
factorial and its value is defined as:
i.e., n!
is the product of the first n
natural numbers.
Factors and multiples
Factors: A factor of a number is a smaller or equal number such that it divides the number exactly and gives the remainder zero. For example:
Factors of Multiples: A multiple of a number, , is a larger number such that the is a factor of that number. For example:
Multiples of
Prime numbers
Prime numbers are natural numbers greater than 1 that cannot be expressed as a product of two smaller natural numbers.
They are natural numbers greater than 1 with only two factors, 1 and the number itself.
Note: A good estimation of the number of primes is . This is useful for complexity analysis.
Modulus operator
The modulus operation between two integers, a % b
, returns the remainder when a
is divided by b
. For example:
The result of the modulus operator is if a
is a multiple of b
.
We can easily check if a number is even with if
if (x % 2 == 0)
.
In the next lesson, we’ll go over set theory, definitions and basic operations.
Get hands-on with 1400+ tech skills courses.