# Prime division

• 08-08-2009
maifs
Prime division
Find out the number of prime numbers that divide a given number 'n' where 'n' lies within the range 1<=n<=10000 (note: 1 is not a prime)

input:
Total number of inputs
n

Output:
The number of prime numbers that divide 'n'

Sample Input:
5
7
18
2220
7140
2

Sample Output:

1
2
4
5
1
• 08-08-2009
Salem
• 08-08-2009
maifs
i want to Find out the number of prime numbers that divide a given number 'n' where 'n' lies within the range 1<=n<=10000 (note: 1 is not a prime)
• 08-08-2009
Spidey
So, then find it out.
• 08-08-2009
Salem
Yes, you said that already.

What have you written so far?
• 08-08-2009
maifs
i want the algorithim of it?
if you can then help me.
thanks
• 08-08-2009
Salem
Find a prime number,
work out whether it is a divisor of 'n' or not,
repeat.

OR
Work out a divisor for 'n',
check whether it is prime or not,
repeat.

What's so hard?
• 08-08-2009
scwizzo
I made a program that does this to an extent, too bad you haven't shown any code that we could help you with. Otherwise I could start pointing you in a certain direction.

EDIT: ok I'll give some help. My algorithm uses Salem's first method.
• 08-08-2009
EVOEx
Quote:

Originally Posted by scwizzo
EDIT: ok I'll give some help. My algorithm uses Salem's first method.

Ha. You think, from the answers so far, this guy is actually going to bother finding out what Salem's first method is about? Or even to write a single line of code? He just wants teh codez.
• 08-09-2009
maifs
thanks
• 08-09-2009
EVOEx
Quote:

Originally Posted by maifs
thanks

You're very welcome. Byebye.