answersLogoWhite

0

The simple (brute-force) way to do it would be something like this:

For every integer i from 2 to n-1 do:

If n modulo i equals 0, output i.

This would be very slow for large n (linear in the size of n, in the best case).

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

Design an algorithm for finding all the factors of positive integerfor example in the case of the integer 12your algorithm should report 12346 and 12?

design an algorithm for finding all the factors of a positive integer


What are the numbers that are not prime or composite?

A prime number is a number with two positive integer factors, while a composite number has more than two positive integer factors. Since the number 0 has no positive integer factors, and the number 1 has just one positive integer factor (itself), neither of these are prime.


What are the factors of 18 and 7?

The positive integer factors of 18 are: 1 2 3 6 9 18 The positive integer factors of 7 are: 1 7 Since 7 is a prime number, the only positive integer common factors of the two numbers is the number 1.


What are the factors of 1941?

The positive integer factors of 1941 are: 1, 3, 647, 1941 The prime factors are 3 and 647.


What are the factors of 311?

The positive integer factors of 311 are: 1, 311


What are the factors of 233?

The positive integer factors of 233 are: 1, 233


What are the factors of 463?

The positive integer factors of 463 are: 1, 463


What are the factors of 1319?

The positive integer factors of 1319 are: 1, 1319


What are the factors of 421?

The positive integer factors of 421 are: 1, 421


What are the factors of 1997?

The positive integer factors of 1997 are: 1, 1997


What are the factors of 167?

The positive integer factors of 167 are: 1, 167


What are the Factors of 151?

The positive integer factors of 151 are: 1, 151