Download presentation

Presentation is loading. Please wait.

Published byClement Todd Modified over 3 years ago

1
A combination of two similar yet different madness…

2
Basic concepts ◦ If a number is even, apart from 2 it is not a prime ◦ If a number is odd, its factors can be 3, 5, 7, 9, … We can essentially eliminate all the even factors ◦ *** (Extra info.) The number is a prime if all factors up till sqrt (number) is not divisible by that number ◦ E.g. number is 61, if 2, 3, 4, 5, 6, 7, 8 cannot divide the number, then there is no way another factor can occur in the range 9 to 61.

4
Basic concepts: ◦ A number still has factors if it is not 1 ◦ For the current number, print out its smallest factor ◦ Then divide the number by its factor ◦ Repeat the process until the number is 1 ◦ *** (Optional) To print out the “x”, check if the number is not 1 (means still have factors) and print out “ x “.

6
Basic concepts: ◦ Divide the number by 2 repeatedly until it has no more factors of 2 ◦ Repeat the process for 3 and 5 ◦ If the resultant number is 1, means the number has no other factors and is a Hamming Number

Similar presentations

OK

Factors Objective – To be able to find all the factors of a given integer.

Factors Objective – To be able to find all the factors of a given integer.

© 2018 SlidePlayer.com Inc.

All rights reserved.

To ensure the functioning of the site, we use **cookies**. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy & Terms.
Your consent to our cookies if you continue to use this website.

Ads by Google

Ppt on agriculture in india pdf Ppt on question tags exercises Using ppt on mac Free ppt on mobile number portability process Ppt on world diabetes day symbol Ppt on sociology of education Ppt on class 10 hindi chapters Ppt on principles of peace building activities Ppt on new year resolutions Ppt on mass media in india