DEV Community

Akash
Akash

Posted on

Python Looping Mathematics

=> Python Looping Mathematics Helping Factors
1.Prime Numbers

  • Prime number is a number greater number that has exactly two Factors (e.g) 1,2,5,7,

2.Factors

  • A number that divides another number without leaving a remainder. (e.g) 1,2,3,4,6,12

3.Least Common Multiple

  • Smallest common multilple of two numbers

(e.g) 4 and 6
4->4,8,,12,16,20
6->6,12,18,24
here least common multiple is 12.

OUTPUT:

4.Greatest Common Factor

  • A largest number that divides both numbers

(e.g) 12 and 18
12->1,2,3,4,6,12
18->1,2,3,6,9,18
here common factors are 1,2,3,6

5.Perfect Number
Perfect number is equals to sum its factors

(e.g) 6
1,2,3,6 are factors of 6
1+2+3=6
so,6 is a perfect number


OUTPUT:

Top comments (0)