3-adic valuation of a sum involving binomial coefficients

The $3$-adic evaluation you seek is compactly given by $$\nu_3(a_{2n})=\nu_3\left(\binom{2n}n\right) \qquad \text{and} \qquad \nu_3(a_{2n+1})=\nu_3\left(3(2n+1)\binom{2n}n\right),$$ which can be proved inductively using the well-known recurrence $$na_n=3(2n-1)a_{n-1}-(n-1)a_{n-2}$$ according to the parity of $n$. To address Cigler's request, here is an illustration for the case even: $(2n)a_{2n}=3(4n-1)a_{2n-1}-(2n-1)a_{2n-2}$ and by induction assumption $$\nu_3(3(4n-1)a_{2n-1})=\nu_3\left(9(4n-1)(2n-1)\binom{2n-2}{n-1}\right) \qquad\text{and}\qquad \nu_3((2n-1)a_{2n-2})=\nu_3\left((2n-1)\binom{2n-2}{n-1}\right).$$ So, $\nu_3(3(4n-1)a_{2n-1})>\nu_3((2n-1)a_{2n-2})$ and $\nu_3((2n)a_{2n})=\nu_3((2n-1)\binom{2n-2}{n-1})$; or, \begin{align} \nu_3(a_{2n})&=\nu_3\left(\frac{(2n-1)}{2n}\binom{2n-2}{n-1}\right) =\nu_3\left(\frac14\binom{2n}n\right)=\nu_3\left(\binom{2n}n\right) \end{align} as desired.


Indeed, the observation by Max Alexseyev seems to provide the idea I need!

The conjecture I made above can be generalized as follows:

Let p > 2 be a prime, and let $L_n (x)$ be the Legendre polynomial. Define $f(n) = \nu_p (L_n (p))$ for $n \geq 0$. Then for $n \geq 0$ and $0 \leq a < p$ we have $f(pn+a) = \begin{cases} f(n) + (n \bmod 2), & \text{if $a$ even}; \\ f(n) + 1 - (n \bmod 2), & \text{if $a$ odd}. \end{cases}$

I will now try to prove this more general statement, which I suspect will actually be easier. It probably follows from Bonnet's recursion formula for the Legendre polynomials $(n+1)P_{n+1}(x)=(2n+1)xP_{n}(x)-nP_{n-1}(x)$.