Question: c++ function to do the following: long tau(long nn) ** @param nn - an integer > 0 ** @return tau(n), defined as: * tau(nn) ==

c++ function to do the following:

long tau(long nn) ** @param nn - an integer > 0 ** @return tau(n), defined as: * tau(nn) == nn if nn is a prime number, * tau(nn) == tau(aa)+tau(bb) * if nn is composite, with nn == aa * bb for integers aa and bb * @example tau(1) = 0 * @example tau(2) = 2, because 2 is prime * @example tau(3) = 3, because 3 is prime * @example tau(6) = 5, because 6 = 2*3, and tau(2)==2, tau(3)==3. * @example tau(12) = 7, because 12 = 2*6, and tau(2)==2, tau(6)==5.

Include explanation as well please!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!