Problem 57293. Compute the unitary totient of a number
The totient function  , the subject of Cody Problems 656 and 50182, gives the number of integers smaller than n that are relatively prime to n--that is, that share no common factors with n other than 1. Therefore,
, the subject of Cody Problems 656 and 50182, gives the number of integers smaller than n that are relatively prime to n--that is, that share no common factors with n other than 1. Therefore,  because 1, 2, 4, 5, 7, and 8 (i.e., six numbers less than 9) are relatively prime to 9.
 because 1, 2, 4, 5, 7, and 8 (i.e., six numbers less than 9) are relatively prime to 9. 
The unitary totient function  is defined in terms of the function gcd*(k,n), which is the largest divisor of k that is also a unitary divisor of n. Then the unitary totient function gives the number of k (with
 is defined in terms of the function gcd*(k,n), which is the largest divisor of k that is also a unitary divisor of n. Then the unitary totient function gives the number of k (with  ) such that gcd*(k,n) = 1. For example,
) such that gcd*(k,n) = 1. For example,  because the unitary divisors of 9 are 1 and 9. Therefore, for
 because the unitary divisors of 9 are 1 and 9. Therefore, for  , the largest divisors that are also unitary divisors of 9 are 1-8.
, the largest divisors that are also unitary divisors of 9 are 1-8. 
Write a function to compute the unitary totient function. 
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
- 
         
         4003 Solvers 
- 
         
         221 Solvers 
- 
         
         1728 Solvers 
- 
         
         54 Solvers 
- 
         Height of a right-angled triangle 1956 Solvers 
More from this Author314
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!