This question has its seed in [this one](https://mathoverflow.net/questions/283716/what-is-the-matter-with-hecke-operators) by Gory, which found an enlightening answer but one of the comments kept me wondering. I am beginning to discover Hecke operators, and there appears to be an ubiquitous relation between Hecke eigenvalues and coefficients of L-functions that I do not get at all. I will try to state everything in details.


**Hecke operators.** Let us fix a place $p$ and consider an unramified local component $\pi\_p$ of an automorphic representation of $GL\_2$ over $F$. Let $K\_p$ denote $GL\_2(\mathcal{O}\_p)$. We define the Hecke operator $T\_{p^i}$ as the convolution action of the characteristic function of
$$\bigcup\_{\substack{a+b = i \\ a \geqslant b}} 
K\_p
\left(
\begin{array}{cc}
p^a & \\
 & p^b
\end{array}
\right)
K\_p$$


**L-functions.** The automorphic representation $\pi$ also has an attached $L$-function (built on the Satake parameters at unramified places and a specific completion defining the remaining factors) which can be written as (and this defines the $\lambda\_\pi(n)$)
$$L(s, \pi) = \sum\_{n \geqslant 1} \lambda\_\pi(n) n^{-s}$$


**Coefficients as eigenvalues.** With all those definitions in hand, if $\phi$ is a function in the (one-dimensional) subspace of $K\_p$-invariant vectors of $\pi\_p$, do we have that
$$T\_{p^i} \star \phi = p^{1/2} \lambda\_\pi(p^i) \phi \quad ?$$


**Questions.** More precisely, I would like to ask both following (maybe elementary) questions:


* I know it for $i=1$ (for instance Gelbart), however does it remain for $i \geqslant 2$, and do you have a proof of that?
* in the case where $\pi\_p$ is ramified, those convolutions always give zero because there is no $K\_p$ invariant vector in $\pi\_p$ but the convolution creates such invariant vectors. In order to get the coefficient $\lambda\_\pi(p^i)$ is this case, can I do exactly the same construction replacing $K\_p$ by $K\_1(p^f)$ where $f$ is the (additive) arithmetic conductor of $\pi\_p$? (in that case the vector space of vectors fixed by it is one-dimensional)


I would appreciate any details or good reference for this matters, thanks in advance!



Relation between Hecke operators and coefficient of L-functions
A normalized version of your guess is right. First note that the $T\_{p^n}$'s satisfy the relation
$$ T\_{p^{n+1}} = T\_p T\_{p^n} - p T\_{p^{n-1}} $$
(e.g., Bump Prop 4.6.4). This gives you a recursion relation among Hecke eigenvalues of $\phi$. E.g., $T\_{p^2} = T\_p T\_p - p T\_1$ says if the eigenvalue for $T\_p$ is $p^{1/2} a\_p$, then the eigenvalue for $T\_{p^2}$ is $p(a\_p^2 - 1)$.


Now you want to compare with coefficients of the Dirichlet series. Say the Satake parameters of $\pi$ are $\alpha=\alpha\_p$ and $\alpha^{-1}$, so $a\_p = \alpha + \alpha^{-1}$ (e.g., Bump Prop 4.6.6--here I'm assuming trivial central character for simplicity). By the Euler product, you only need to look at the coefficients of the Dirichlet series for the factor at $p$, which is defined to be
$$ L\_p(s,\pi) = \frac 1{1-\alpha p^{-s}} \frac 1{1-\alpha^{-1} p^{-s}}
= (\sum \alpha^i p^{-is} )( \sum \alpha^{-j} p^{-js} ) $$
Here the coefficient of $p^{ns}$ is 
$$ c\_n := \lambda\_\pi(p^n) = \sum\_{i+j=n} \frac{\alpha^i}{\alpha^j}. $$
Now it is not hard to see the $c\_n$'s satisfy the relation
$$ c\_{n+1} = c\_1 c\_n - c\_{n-1}. $$
For instance, for $n=2$, we have $c\_2 = c\_1 c\_1 - c\_0 = a\_p^2 - 1$.
Comparing with the Hecke recurrence, one gets
$$ a\_{p^n} = p^{\frac n2} c\_n = p^{\frac n2} \lambda\_\pi(p^n), $$
where $a\_{p^n}$ is the eigenvalue of $T\_{p^n}$.


For ramified representations, yes you can define Hecke operators using appropriate congruence subgroups $K\_0(p^n)$ or $K\_1(p^n)$, but you should do this a little differently if you want to get coefficients of Dirichlet series of newforms as Hecke eigenvalues. That is, you shouldn't look at all double cosets in $GL\_2(\mathbb Z\_p$). See e.g. the book of Knightly and Li.


