Finding Divisors, Number of Divisors and Summation of Divisors. Jane Alam Jan

Similar documents
2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Fall 2017 Test II review problems

ZEROS OF POLYNOMIAL FUNCTIONS ALL I HAVE TO KNOW ABOUT POLYNOMIAL FUNCTIONS

Intermediate Math Circles February 14, 2018 Contest Prep: Number Theory

We say that a polynomial is in the standard form if it is written in the order of decreasing exponents of x. Operations on polynomials:

Number Theory. Introduction

The theory of numbers

A number that can be written as, where p and q are integers and q Number.

Algorithms lecture notes 1. Hashing, and Universal Hash functions

b) since the remainder is 0 I need to factor the numerator. Synthetic division tells me this is true

Sums of Squares. Bianca Homberg and Minna Liu

A First Look at the Complex Modulus

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

PMA225 Practice Exam questions and solutions Victor P. Snaith

2.2 Inverses and GCDs

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers

TESTCRACKER CAT TOPPER s PROGRAM: QUANT. Factorial

Cool Results on Primes

Math Lecture 18 Notes

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

1 The Well Ordering Principle, Induction, and Equivalence Relations

MULTIPLYING TRINOMIALS

Modular Arithmetic Instructor: Marizza Bailey Name:

Number Theory. Number Theory. 6.1 Number Theory

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

Chapter 1 A Survey of Divisibility 14

Quantitative Aptitude

UNCC 2001 Algebra II

Number theory (Chapter 4)

The numbers 1, 2, 3, are called the counting numbers or natural numbers. The study of the properties of counting numbers is called number theory.

Examples of Finite Sequences (finite terms) Examples of Infinite Sequences (infinite terms)

Notes on arithmetic. 1. Representation in base B

Fibonacci mod k. In this section, we examine the question of which terms of the Fibonacci sequence have a given divisor k.

SECTION 2.3: LONG AND SYNTHETIC POLYNOMIAL DIVISION

All About Numbers Definitions and Properties

The Impossibility of Certain Types of Carmichael Numbers

4. Number Theory (Part 2)

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

OBTAINING SQUARES FROM THE PRODUCTS OF NON-SQUARE INTEGERS

Commutative Rings and Fields

Math 3 Variable Manipulation Part 3 Polynomials A

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

PRIME NUMBERS YANKI LEKILI

Discrete Structures Lecture Primes and Greatest Common Divisor

Summary: Divisibility and Factorization

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics

SEVENTH EDITION and EXPANDED SEVENTH EDITION

SECTION 2.5: FINDING ZEROS OF POLYNOMIAL FUNCTIONS

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Admin. ! Will post sample questions soon. 1. Choose a bit-length k. 2. Choose two primes p and q which can be represented with at most k bits

Counting Perfect Polynomials

Some Review Problems for Exam 3: Solutions

MODEL ANSWERS TO HWK #7. 1. Suppose that F is a field and that a and b are in F. Suppose that. Thus a = 0. It follows that F is an integral domain.

n = p 1 p 2 p r = q 1 q 2 q m, then r = m (i.e. the number of primes in any prime decomposition

Mathematics 228(Q1), Assignment 2 Solutions

ANOTHER METHOD FOR FACTORING SEMI-PRIMES

COS597D: Information Theory in Computer Science October 19, Lecture 10

MODEL ANSWERS TO THE FIRST HOMEWORK

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Sequences and Summations

Multiplication of Polynomials

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Divisors. Common divisors. Let m, n P Z with m 0. Wesaythatm divides n if n is a multiple of m, i.e.

7x 5 x 2 x + 2. = 7x 5. (x + 1)(x 2). 4 x

Warm-Up. Simplify the following terms:

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Mathematical Problem Solving TEAM A-11/12/2010

#26: Number Theory, Part I: Divisibility

Primes and Modular Arithmetic! CSCI 2824, Fall 2014!!

Item 6. Pi and the Universe. Gives Applications to the Geometry of our Universe. 5 Total Pages

More AMC 8 Problems. Dr. Titu Andreescu. November 9, 2013

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6

Chapter 3: Factors, Roots, and Powers

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3

Rings and modular arithmetic

CSCE 222 Discrete Structures for Computing. Proofs. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Questionnaire for CSET Mathematics subset 1

EXAMPLES OF MORDELL S EQUATION

Direct Proof Divisibility

7.2 Applications of Euler s and Fermat s Theorem.

Chapter 3: Polynomial and Rational Functions

Divisibility of Natural Numbers

Direct Proof Divisibility

CSCB63 Winter Week10 - Lecture 2 - Hashing. Anna Bretscher. March 21, / 30

Roots of Unity, Cyclotomic Polynomials and Applications

Exam 2 Review Chapters 4-5

Proof by Contradiction

October 28, S4.4 Theorems about Zeros of Polynomial Functions

Intermediate Math Circles March 6, 2013 Number Theory I

Ch 4.2 Divisibility Properties

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

GRE Quantitative Reasoning Practice Questions

Rational Numbers. Chapter INTRODUCTION 9.2 NEED FOR RATIONAL NUMBERS

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Computer Architecture 10. Residue Number Systems

SUMS OF SQUARES WUSHI GOLDRING

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Warm-Up. g x. g x in the previous (current) ( ) ( ) Graph the function that agreed with. problem.

Transcription:

Finding Divisors, Number of Divisors and Summation of Divisors by Jane Alam Jan

Finding Divisors If we observe the property of the numbers, we will find some interesting facts. Suppose we have a number 36. 36 is divisible by 1, 2, 3, 4, 6, 9, 12, 18 and 36. It is clear that if a is divisible by b, then a is also divisible by (a/b). That means, 36 is divisible by 3, so, this property helps us to find that 36 will also be divisible by 12 (36/3). Now we will make two lists, if a is divisible by b, then we will take b into the first list and (a/b) into the second list. So, for 36, we will evaluate our idea. 36 is divisible by 1. So, it will be added in list 1, and (36/1) = 36 will be added in list 2. List 1: 1 List 2: 36 36 is divisible by 2. So, it will be added in list 1, and (36/2) = 18 will be added in list 2. List 1: 1 2 List 2: 36 18 36 is divisible by 3. So, it will be added in list 1, and (36/3) = 12 will be added in list 2. List 1: 1 2 3 List 2: 36 18 12 36 is divisible by 4. So, it will be added in list 1, and (36/4) = 9 will be added in list 2. List 1: 1 2 3 4 List 2: 36 18 12 9 36 is divisible by 6. So, it will be added in list 1, and (36/6) = 6 will be added in list 2. List 1: 1 2 3 4 6 List 2: 36 18 12 9 6 Now, see that if we move further we will find the numbers again (some numbers from list 2, which will try to insert into list 1) So, it is clear that, if we have list 1, we can generate list 2 (from this position). 1 P a g e

So, we can stop checking if we find b, for which a/b is less than or equal to b. If we try to divide by numbers greater than b, we would actually repeat the same steps. For 36, (check the lists) the next number that will be included to list 1 is 9, but 36/9 = 4, which is already in list 1. Now we have to find b for which a/b is less than or equal to b. If we think mathematically, b >= a/b or, b 2 >= a or, b >= sqrt(a) so, b minimum = sqrt(a) So, we have already found an idea to find divisors of a number in complexity - sqrt(n). And of course, we can count them to find the number of divisors and summing them to find the summation of divisors. 2 P a g e

Finding Number of Divisors Now, we want to find the number of divisors of an integer. It can be done easily by finding all the divisors and finally counting them as described above. But there is a simpler idea. If we know the prime factorization of a number, we can easily find the number of divisors. For example, 18 has 6 divisors. If we prime factorize 18, we find that 18 = 2 1 * 3 2 We can say that any divisor of 36 should be in the form 2 x * 3 y where 0 <= x <= 1 and 0 <= y <= 2 This can be proved easily, but if we think a bit we will find that the reason is obvious. So, the divisors are, 2 0 * 3 0 = 1 2 0 * 3 1 = 3 2 0 * 3 2 = 9 2 1 * 3 0 = 2 2 1 * 3 1 = 6 2 1 * 3 2 = 18 That means we are taking all possible solutions. These form the number of divisors. Just see the pattern of the prime factors of the divisors. So, we can say that the number of divisors of 18 is (1 + 1) * (2 + 1) = 6 So, if a number is factorized as 2 x * 3 y Then the number of divisors is (x+1) * (y+1). Again, the reason is 2 0 * 3 0 2 0 * 3 1... y + 1 divisors 2 0 * 3 y-1 2 0 * 3 y 2 1 * 3 0 2 1 * 3 1... y + 1 divisors 2 1 * 3 y-1 2 1 * 3 y 3 P a g e

... 2 x * 3 0 2 x * 3 1... y + 1 divisors 2 x * 3 y-1 2 x * 3 y So, there are (x+1) sections each having (y+1) divisors, which means a total of (x+1) * (y+1) divisors. Now, let's find the total number of divisors of 60. 60 = 2 2 * 3 * 5 So, similarly the divisors are 2 0 * 3 0 * 5 0 = 1 2 0 * 3 0 * 5 1 = 5 2 0 * 3 1 * 5 0 = 3 2 0 * 3 1 * 5 1 = 15 2 1 * 3 0 * 5 0 = 2 2 1 * 3 0 * 5 1 = 10 2 1 * 3 1 * 5 0 = 6 2 1 * 3 1 * 5 1 = 30 2 2 * 3 0 * 5 0 = 4 2 2 * 3 0 * 5 1 = 20 2 2 * 3 1 * 5 0 = 12 2 2 * 3 1 * 5 1 = 60 So, total number of divisors is 12. Let's check it in another way. For each section of 2 (2 0, 2 1 or 2 2 ) the number of divisors are same. So, there are 3 sections for 2. Now for each section of 2, there are two sections for 3 (3 0, 3 1 ). Now for any combination of 2 and 3 there are two sections for 5 (5 0, 5 1 ). So, it can be represented as (2 0, 2 1, 2 2 ) and (3 0, 3 1 ) and (5 0, 5 1 ) So, at first take any power of 2, after that take any power of 3 and after that take any power of 5 from the above sections. So, we can take 2 in three ways, 3 in two ways and 5 in two ways. So, total ways (or total divisors) are 3 * 2 * 2 = 12 4 P a g e

Similarly, suppose a number is factorized as 2 x * 3 y * 5 z, so, the total number of divisors is (x + 1) * (y + 1) * (z + 1) Now, the general formula is If the prime factorization of an integer is p x1 1 * p x2 2 * p x3 xn 3 *... * p n where, p 1, p 2,..., p n are primes, then the number of divisors is (x 1 + 1) * (x 2 + 1) * (x 3 + 1) *... * (x n + 1) 5 P a g e

Finding Summation of Divisors Suppose we want to find the summation of all the divisors of an integer. We can do it by finding all the divisors and then summing them. But we can make it better. The idea is as follows. Let's say we want to find the summation of divisors of 60. From previous section, we know that the divisors are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 and 60; so the summation is 168. The summation can be written as (summing up all the divisors in their factorized form), 2 0 * 3 0 * 5 0 + 2 0 * 3 0 * 5 1 + 2 0 * 3 1 * 5 0 + 2 0 * 3 1 * 5 1 + 2 1 * 3 0 * 5 0 + 2 1 * 3 0 * 5 1 + 2 1 * 3 1 * 5 0 + 2 1 * 3 1 * 5 1 + 2 2 * 3 0 * 5 0 + 2 2 * 3 0 * 5 1 + 2 2 * 3 1 * 5 0 + 2 2 * 3 1 * 5 1 It can be written as, 2 0 * (3 0 * 5 0 + 3 0 * 5 1 + 3 1 * 5 0 + 3 1 * 5 1 ) + 2 1 * (3 0 * 5 0 + 3 0 * 5 1 + 3 1 * 5 0 + 3 1 * 5 1 ) + 2 2 * (3 0 * 5 0 + 3 0 * 5 1 + 3 1 * 5 0 + 3 1 * 5 1 ) can be written as (2 0 + 2 1 + 2 2 ) * (3 0 * 5 0 + 3 0 * 5 1 + 3 1 * 5 0 + 3 1 * 5 1 ) can be written as (2 0 + 2 1 + 2 2 ) * (3 0 * (5 0 + 5 1 ) + 3 1 * (5 0 + 5 1 )) can be written as (2 0 + 2 1 + 2 2 ) * (3 0 + 3 1 ) * (5 0 + 5 1 ) Now, we know that the summation of series 1 + r + r 2 + r 3 + r 4 + + r n = rn+1 1 r 1 So, the summation can be written as 2 3 1 1 32 1 2 52 1 4 = 7 4 6 = 168 So, the result is same as we have calculated. 6 P a g e

So, if the prime factorization of an integer is p 1 x 1 p 2 x 2 p n x n where, p 1, p 2,..., p n are primes, then the summation of divisors is Discussion p 1 x 1 +1 1 p 1 1 p 2 x 2+1 1 p 2 1 p n x n +1 1 p n 1 After finding the prime factorization, these ideas are easy to code. Before get to coding, try to understand them fully. 7 P a g e