1

I am trying to understand this proof: Prove that $\varphi(p^k)=p^k-p^{k-1}$ for prime $p$

At some point it is stated that the number of multiples of p in range $[1,p^k)$ is $p^{k-1}$.
I am struggling to get why. I tried this:
The multiples of p are : $$p, 2p, .., (p-1)p, p^2, 2p^2, .., (p-1)p^2, .., p^{k-1}, 2p^{k-1}, .., (p-1)p^{k-1}$$

Now I can think in terms of powers of p : Each power $p^i$ contributes $p-1$ mutliples : $$p^i, 2p^i, .., (p-1)p^i$$

And we have $k-1$ distinct powers so $(k-1)\times (p-1)$ multiples of p in total. Of course that's really different from the actual result. I cannot see what I am missing here.

Bill Dubuque
  • 282,220
  • 4
    Forget about prime powers for the moment. How would you calculate for example how many multiples of 7 there are below 1000? – Jaap Scherphuis Feb 20 '23 at 10:26
  • 1
    By the way, in the link they are looking at multiples of $p$ in the range $[1,p^k]$, not $[1,p^k)$, so the list should end with $p^k$ itself. – Jaap Scherphuis Feb 20 '23 at 10:32
  • I guess $\lfloor 1000/7 \rfloor-1$? – tonythestark Feb 20 '23 at 10:34
  • @tonythestark why do you need a $-1$ when you already have the floor function? – D S Feb 20 '23 at 12:39
  • I was thinking that for example how many multiples of 2 are below 10 ? 10/2=5 but below 10 are only 4 : 2, 4, 6, 8 – tonythestark Feb 20 '23 at 13:44
  • The number of multiples of $k$ in $[1,n]$ is $\lfloor\frac{n}{k}\rfloor$. So the answer to my question would be $\lfloor \frac{999}{7} \rfloor$. This happens to be the same as $\lfloor \frac{1000}{7} \rfloor$ since $1000$ is not itself a multiple of $7$. – Jaap Scherphuis Feb 20 '23 at 16:13

2 Answers2

3

Your powers-based counting only counts those numbers that are "pure" powers of $p$ – those numbers that when written in base $p$ have only one nonzero digit. Your counting omits numbers like $p+p^2$.


Ellipses can also deceive you. Did you notice when writing $$p, 2p, .., (p-1)p, p^2, 2p^2, .., (p-1)p^2, .., p^{k-1}, 2p^{k-1}, .., (p-1)p^{k-1}$$ that the separation between, say, $p^2$ and $2p^2$ is greater than $p$? This means there are more multiples of $p$ in between them.

Parcly Taxel
  • 105,904
2

Anything less than or equal to $p^{k-1}$ can be multiplied by $p$ and not go over $p^k.$

So there's exactly $p^{k-1}$ non-totatives.

Subtract those out to get $p^k-p^{k-1}$ totatives.