Discrete log for prime powers I was fiddling around and found that a function of the form $$L_b (x)=\left(\frac{b^{\phi (p^k)}-1}{p^k}\right)^{-1}\left(\frac{x^{\phi (p^k)}-1}{p^k}\right) \mod p^k$$ seems to behave similarly to a discrete logarithm modulo $p^k$ (explained below), assuming $p \nmid x$, $p \nmid b$, and $p^{k+1} \nmid b^{\phi(p^k)}-1$.  
For example, if $p^k=9$ and $b=2$, then $L_2(2)=1, L_2(4)=2, L_2(8)=3$.  
However, there seems to be some errors, such as (with the same modulus) $L_2 (16)=7$, when its discrete logarithm is actually $4$

To clarify what I meant by having properties similar to a discrete logarithm: 
Proposition 1. $L_b (xy)=L_b (x) + L_b (y)$, for $x$ and $y$ coprime to $p^k$.
$\underline{Proof}$: Let $\phi (n)$ be Euler's Totient function.  Then
$$(x^{\phi (p^k)}-1)(y^{\phi (p^k)}-1) \equiv 0 \mod p^{2k} \Rightarrow$$
$$(xy)^{\phi (p^k)}-1 \equiv (x^{\phi (p^k)}-1)+(y^{\phi (p^k)}-1) \mod p^{2k} \Rightarrow$$
$$\frac{(xy)^{\phi (p^k)}-1}{p^k} \equiv \frac{x^{\phi (p^k)}-1}{p^k}+\frac{y^{\phi (p^k)}-1}{p^k} \mod p^k \Rightarrow$$
$$L_b (xy) \equiv L_b (x) + L_b (y) \mod p^k$$
Note that in the last step, we multiplied by $\left(\frac{b^{\phi(p^k)}-1}{p^k}\right)^{-1}$.  Admittedly, $\phi$ could be replaced with Carmichael's function, and I believe it would still work. 
Proposition 2. If $x=b^r$ for residue $r \mod p^k$, then $L_b (x)=r \mod p^k$.
$\underline{Proof}$: We have the following $$L_b (x)=\left(\frac{b^{\phi (p^k)}-1}{p^k}\right)^{-1} \left(\frac{x^{\phi (p^k)}-1}{p^k} \right)=\\\left(\frac{b^{\phi (p^k)}-1}{p^k}\right)^{-1} \left(\frac{(b^r)^{\phi (p^k)}-1}{p^k} \right)=\\ \left(\frac{b^{\phi (p^k)}-1}{p^k}\right)^{-1}\left(\frac{b^{\phi (p^k)}-1}{p^k}+\frac{b^{\phi (p^k)}-1}{p^k}+\dots \frac{b^{\phi (p^k)}-1}{p^k} \right)=\\ 1+1+ \dots +1 \equiv r \mod p^k$$
However, due to the previously mentioned errors, I must have made some sort of mistake.  
If someone could look this over, explain the mistake and possibly suggest a better modified function, it would be much appreciated

for $p$ prime and $gcd(x,p) = 1$ let $$f(x) = \frac{x^{p-1}-1}{p}$$
by Fermat theorem $x^{p-1}-1 = k p,y^{p-1}-1 = m p$ so $(x^{p-1}-1)(y^{p-1}-1) = kmp^2$ i.e.
$$\frac{(x^{p-1}-1)(y^{p-1}-1)}{p} \equiv \frac{(xy)^{p-1}-x^{p-1}-y^{p-1}+1}{p}\equiv 0 \bmod p$$
$$\implies f(xy) \equiv f(x)+f(y) \bmod p$$
but this is not a discrete logarithm modulo $p$
for the simple reason that a discrete logarithm modulo $p$ fulfills :
$$g(xy) \equiv g(x)+g(y) \bmod p-1$$
since the discrete logarithm is a group isomorphism $$((\mathbb{Z}/p\mathbb{Z})^*,\times) \quad \to \quad \ (\mathbb{Z}/(p-1)\mathbb{Z},+)$$
