14,925,905 members
See more:
Given a number N, let P be the set of all the prime divisors of N. Now, let S be another set of all the divisors of N (including 1 and N). Let's define the term Prime Score of a prime divisor x as the number of elements in S which have x as a prime divisor. Output the product of prime scores of all the elements in P modulo 1000003.
For example, let N be 12. Set P will be {2, 3} and set S will be {1, 2, 3, 4, 6, 12}. Now, 2 is a prime divisor of 4 elements in S (2, 4, 6, 12) and 3 is a prime divisor of 3 elements in S (3, 6, 12). So, the prime scores of 2 and 3 would be 4 and 3. respectively. So. the output will be 4*3 mod 1000003 = 12 .

What I have tried:

can anyone give me a solution?
Posted
Updated 8-May-21 14:32pm

## Solution 1

As I told you an hour ago:
Quote:
While we are more than willing to help those that are stuck: that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]

## Solution 2

Quote:
Can any one provide solution for this problem in C or java?

Yes, I can, I will not.
As programmer, your job is to create algorithms for such problems. Having us doing the job can help you to give a correct answer for your homework, but it will never help you to learn how to do the job.

To create your own program solution, start by solving the problem by hand.
Your procedure to solve the problem by hand is basically your algorithm, just have to translate to code.

- Learn one or more analyze methods, E.W. Djikstra/N. Wirth Stepwize Refinement/top-Down method is a good start.
Structured Programming.pdf[^]
https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design[^]
https://en.wikipedia.org/wiki/Structured_programming[^]
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra[^]
https://www.cs.utexas.edu/users/EWD/ewd03xx/EWD316.PDF[^]
Program Development by Stepwise Refinement[^]
- Learn Algorithms and Data-Structures.
GitHub - The-Art-of-Computer-Programming-Books: "Everyday life is like programming, I guess. If you love something you can put beauty into it." ? Donald E. Knuth[^]
Skiena The Algorithm Design Manual