answersLogoWhite

0

That depends what you need to "solve". If what you want to do is check whether a number is prime or composite, check whether it is divisible by 2, and then by all odd numbers up to the square root of your number. For example, for numbers up to 120, you only need to check whether they are divisible by 2, 3, 5, 7 (9 is composite, so you don't really need to check divisibility by 9). If your number is divisible by any such number, then it is composite; otherwise it is a prime.

There are more efficient methods, but they are also more complicated, and it really only makes sense to use them for much larger numbers.

User Avatar

Wiki User

8y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
More answers

A Prime number has only 2 factors which are 1 and itself. Composite numbers are everything else except 1 and 0. 1 and 0 have a different name.

User Avatar

Wiki User

13y ago
User Avatar

Add your answer:

Earn +20 pts
Q: How do you solve prime and composite numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp