Upper bound on the order of the centralizer of the affine subgroup of $Sym(\mathbb{Z_n})$ Suppose $Sym(\mathbb{Z_n})$ is the group of all permutations of $\mathbb{Z_n}$.
Let $AF(n)$ denote affine group (the group of all mappings, that send $ x \ to\ ax+b $ for some $a$ and $b$ from $\mathbb{Z_n}$), which is a subgroup of $Sym(\mathbb{Z_n})$ and $C(g)$ denote the centralizer of an element $g$ in $Sym(\mathbb{Z_n})$. Is there a non-trivial upper bound on $\vert \lbrace{ C(k): k\in AF(n), k\neq 1\rbrace}\vert$? You may consider $n$ to be prime if required but upper bounds for general $n$ are better. 
 A: The answer below was in response to an earlier incorrectly edited version of the question.

The affine group $\mathrm{Aff}(d,\mathbb{Z}_p)=(\mathbb{Z}_n^d,+)\rtimes \mathrm{GL}(d,\mathbb{Z}_p)$ is special case of a holomorph
$$ \mathrm{Hol}(G)=G\rtimes\mathrm{Aut}(G). $$
There is an action $\mathrm{Hol}(G)\to\mathrm{Perm}(G)$ which sends $\mathrm{Aut}(G)$ to itself and $G$ to left-multiplications-by-$g$s, as per Cayley's theorem. Say we want to find the centralizer $C$ of $\mathrm{Hol}(G)$ within $\mathrm{Perm}(G)$.
Every element of $\mathrm{Hol}(G)$ looks like $a\beta(x)$ for some $a\in G$, $\beta\in\mathrm{Aut}(G)$. Suppose $\sigma\in C$. Then
$$ \sigma(a\beta(x))=a\beta(\sigma(x)) $$
identically. This can be broken up into two types of centralizing:
$$ \sigma(ax)=a\sigma(x), \qquad \sigma(\beta(x))=\beta(\sigma(x)). $$
The first implies $\sigma(a)=a\sigma(0)$. Substituting into the second,
$$ \beta(x)\sigma(0)=\beta(x\sigma(0))=\beta(x)\beta(\sigma(0)), $$
which is equivalent to $\beta(\sigma(0))=\sigma(0)$ for all $\beta\in\mathrm{Aut}(G)$.
Therefore, all $\sigma\in C$ are of the form $\sigma(x)=xg$ where $g\in AZ(G)$ is in the absolute center.
(A similar exercise shows the normalizer of $\mathrm{Hol}(G)$ in $\mathrm{Perm}(G)$ is $R(G)$, the set of all right-multiplications $\sigma(x)=xg$ for all $g\in G$.)
In the case of $G=(\mathbb{Z}_n,+)$, the group operation is addition rather than multiplication, and the automorphisms are of the form $\beta(x)=bx$ for $b\in\mathbb{Z}_n^{\times}$. Our centralizing elements $\sigma(x)=x+y$ satisfy $by=y$ for all $b\in\mathbb{Z}_n$. If $n=2^km$ with $m$ odd we may write $\mathbb{Z}_n=\mathbb{Z}_{2^k}\times\mathbb{Z}_m$ (as rings even) and $b$ corresponds to $(b_0,b_1)$ with $b_0\in\mathbb{Z}_{2^k}^{\times}$ and $b_1\in\mathbb{Z}_m^{\times}$ and $y=(u,v)$. Setting $b=(1,2)$ in $by=y$ indicates $v=0$ and setting $b=(1+2^{k-1},1)$ indicates $u$ is even. Within $\mathbb{Z}_n$ this means $y$ is a multiple of $2m$.
The additive subgroup of $\mathbb{Z}_n$ generated by $2m$ has $n/(2m)=2^{k-1}$ elements if $k\ge 1$ and only $1$ element if instead $k=0$, i.e. if $n$ is odd.
A: I am not going to attempt to prove this for the moment, but I conjecture that the largest centralizer in $S_n$ occurs when $n = 2^k$ for some $k$,  with $g \in {\rm AF}(n)$ equal to the permutation $x \mapsto (2^{k-1}+1)x \bmod n$.
Then $g$ is an involution with $n/2$ fixed points (the even integers) and $n/4$ transpositions. Its centralizer in $S_n$ has order $\frac{n}{2}!\,\frac{n}{4}!\,2^{n/4}$.
