Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have tried writing this problem but I keep getting errors andcannot get it to

ID: 3615194 • Letter: I

Question

I have tried writing this problem but I keep getting errors andcannot get it to work even with the algorithm below. Pleasehelp.


Write a function to output the prime factors of a number.
void computePrimeFactors(int Number)

The following statements describes the prime factors…
1. If n is even, one factor is 2, then find the prime factors ofn/2
2. If n is divisible by 3, remove this factor and then find theprime factors of the
remainder.
3. If n is divisible by 5, remove this factor and then find theprime factors of the
remainder.
4. and so on…

Here is a description of the above algorithm, where pfr and pf arefunctions…
pfr(n) = 2 and pfr(n/2), if n is even
pfr(n) = pf(n,3), if n is odd

pf(n,m) = none, if n = 1
pf(n,m) = n, if n < m*m
pf(n,m) = m and pf(n/m,m), if m divides n
pf(n,m) = pf(n,m+2), otherwise

Explanation / Answer

#include#includepf_r(long x){long i; /* counter */long c; /* remaining product to factor */c = x;if ((c % 2) == 0) {printf("%ld ",2);c = c / 2;pf_r(c);return;}else{pf(x,3);}}pf(long c,int n){int i;i=n;if(n==1)return;if(n