a. Because 62≡2(mod17), conditions (i) and (ii) imply
f(2)≡f(62)≡2f(6)(mod8)
If a loggy function f satisfies f(2)≡1(mod8), we get 2f(6)≡1(mod8). But the congruence 2x≡1(mod8) has no solution x∈Z. Hence, there does not exist a loggy function satisfying f(2)=1.
b. Note that (ii) implies that f(xn)≡nf(x)(mod8) for all x that are not divisible by 17. In particular, f(3n)≡nf(3)(mod8). If f(3)=1, this means that for all positive integers n we need to have f(3n)≡n(mod8).
We claim that each integer x that is not divisible by 17 is congruent to 3n(mod17) with a unique 1≤n≤16. The reason is that the multiplicative order of 3 (mod 17) is equal to 16. In other words, no two of the numbers 3n,n=1,2,…,16 are congruent (mod 17). To see this, suppose 3a≡3n(mod17) for some 1≤a≤16. If d=gcd(a,16), there exist positive integers r,s such that either ar=d+16s, or 16s=d+ar. Because 3a≡316≡1(mod17) both equations imply 3d≡1(mod17). As d is a factor of 16, we just check
32≡9(mod17),34≡−4(mod17),38≡−1(mod17)
to see that d=16 and so a=16 as well. Therefore, if 1≤m≤n≤16 and 3m≡3n(mod17), we have 3n−m≡1(mod17) and m=n would imply n−m=16, which is impossible.
Define a function f:Z→Z as follows:
f(x)=0whenever x≡0(mod17)
f(x)=nwhenever x≡3n(mod17) with 1≤n≤16.
Because the value of f depends only on x (mod 17), condition (i) is satisfied. The function is defined for all integers, because each integer that is not divisible by 17 is congruent to a unique 3n(mod17). Finally, to see that Condition (ii) holds, let m and n both be integers between 1 and 16 and note that in case m+n>16, we have 3m+n≡3m+n−16(mod17) by Fermat's Little Theorem and so
f(3m+n)=f(3m+n−16)=m+n−16≡m+n(mod8).
Hence, we obtain the required
f(3m⋅3n)=f(3m+n)≡m+n≡f(3m)+f(3n)(mod8).
Therefore, this function is a loggy function that satisfies f(3)=1.