Determine the number of elements in $Z/13^5Z$ (respectively $Z/(11×13^2 )Z$) which are cubes, i.e. the third power of elements of $Z/13^5Z$ (respectively $Z/(11×13^2 )Z$)
My start: $g$ is a primitive root, so we need to determine how many distinct elements we can get of the form $(g^a)^3\mod 13^5$ where $a$ ranges from $1 \ldots m = \phi(13^5)$. From here I am a bit confused as to find how many elements there are, and then how many third powers in total. We were given a hint for the last step: "if an element of $Z/13^5Z$ can be written as $x = 13^i*b$ where $b$ is coprime to 13, what can you say about $x^3 = 13^{3i}*b^3$?"
If $x=13^ib$, we can do cases with $i$. If $i\geq 2$, then $x^3 \equiv 0 \pmod{13^5},$ which gives us $1$ cube.
If $i=0$, then we count the cubes relatively prime to $13$. These are exactly the powers of $g^3$ and there are $\phi(13^5)/3 = 4\times 13^4$ of them.
If $i=1$, then we seek cubes of the form $13^3b^3 \pmod{13^5}$. If $x^3 \equiv 13^3b^3 \pmod{13^5},$ then $x=13y$ for some $y$ and we have $y \equiv b^3 \pmod{13^2}.$ If $h$ is a primitive root of $13^2$, we argue as above and count $\phi(13^2)/3 = 4\times 13=52$ more cubes.
That gives $1 +4\times 13^4 +52=114,297$ cubes in all.