Since 80=24⋅5, its positive divisors are 1,2,4,5,8,10,16,20,40,80.
For an integer n to share exactly two positive common divisors with 80, these divisors must be either 1 and 2 or 1 and 5. (1 is a common divisor of any two integers. The second common divisor must be a prime number since any composite divisor will cause there to be at least one more common divisor which is prime.)
Since 1≤n≤30 and n is a multiple of 2 or of 5, then the possible values of n come from the list 2,4,5,6,8,10,12,14,15,16,18,20,22,24,25,26,28,30 We remove the multiples of 4 from this list (since they would share at least the divisors 1,2,4 with 80) and the multiples of 10 from this list (since they would share at least the divisors 1,2,5,10 with 80).
This leaves the list 2,5,6,14,15,18,22,25,26 The common divisors of any number from this list and 80 are either 1 and 2 or 1 and 5.
There are 9 such integers.
We start with f(50) and apply the given rules for the function until we reach f(1): f(50) = f(25) (since 50 is even and 1 2 (50)=25 ) = f(24) + 1 (since 25 is odd and 25-1 = 24 ) = f(12) + 1 ( 1 2 (24)=12 ) = f(6) + 1 ( 1 2 (12)=6 ) = f(3) + 1 ( 1 2 (6)=3 ) = (f(2) + 1) + 1 ( 3 -1 = 2 ) = f(1) + 1 + 1 ( 1 2 (2)=1 ) = 1 + 1 + 1 ( f(1)=1 ) = 3 Therefore, f(50)=3.