Prime Numbers ஐ எப்படி கணக்கிடுவது
Prime Numbers என்றால் என்ன?
A prime number is a whole number greater than 1 that has exactly two factors: 1 and itself. Primes are the "atoms" of arithmetic — every integer greater than 1 can be written as a unique product of primes (fundamental theorem of arithmetic).
படிப்படியான வழிகாட்டி
- 1Check if the number is greater than 1
- 2Try dividing by every integer from 2 up to √n
- 3If none divide evenly, the number is prime
- 4If any divide evenly, it is composite (not prime)
தீர்க்கப்பட்ட எடுத்துக்காட்டுகள்
உள்ளீடு
17
முடிவு
Prime
Not divisible by 2, 3
உள்ளீடு
51
முடிவு
Composite
51 = 3 × 17
உள்ளீடு
97
முடிவு
Prime
Not divisible by 2,3,5,7