If an abelian group $G$ has order $2^n$ where $n$ is a positive integer, what are the possible values for the number of elements of $G$ of order $2$? If an abelian group $G$ has order $2^n$ where $n$ is a positive integer, what are the possible values for the number of elements of $G$ of order $2$?
Okay so my first thought was what do all abelian groups have in common. I know that they are commutative. But this does not really give much information on the order of the elements.
My next thought was that the order of an element must divide the order of the group. Well I know that 2 will always divide $2^n$ so this does help a little because I know that there are elements of that order.
This is where I got stuck. I'm not sure what I can do to find the number of elements of order 2. I am assuming it will be an arbitrary number as well, but I also don't have any evidence to back that up it is just intuition
 A: The set of all elements of order $2$, together with the identity, forms a subgroup. Indeed, if $a$ and $b$ have order two, then $(ab)^2 = a^2b^2=e$, so either $ab=e$ or $ab$ has order $2$. Since the order of a subgroups divides the order of the group, that means this subgroup must have order $2^k$ for $0\leq k\leq n$; this count includes the identity, so we need to subtract $1$. On the other hand, $G$ will necessarily have at least one element of order $2$ by Cauchy's Theorem, so in fact $k=0$ is impossible. Thus, as a preliminary matter, we have that the number of elements of order $2$ is of the form $2^k-1$, with $1\leq k\leq n$.
Can all such values be achieved by some group of order $2^n$? Well, let's see...

*

*We can get exactly $2^1-1 = 1$ element of order $2$ by taking the cyclic  group of ordr $2^n$.


*We can get exactly $2^2-1=3$  elements of order $2$ by taking the product of two nontrivial cyclic groups of appropriate orders: each has exactly one element of order $2$, and we can verify that the product has exactly $3$.


*We can get exactly $2^3-1=7$ by taking a product of a group with exactly $3$ and a group with exactly $1$ (prove that this it he case)


*$\vdots$
