$$ f_3(n, q) = \sum_{i=0}^{2n}q^i, \space n \in \N_0, \space q \in \R $$

$$ \underbrace {q^1 + q^2 + ... + q^{\overbrace{2n-2}^{2 \cdot (n-1)}}}_{f_3(n-1, \space q)} + q^{2n-1} + q^{2n} $$

f3 :: Int -> Float -> Float
f3 0 q = 0
f3 n q = (f3 (n-1) q) + q^(2*n -1) + q^(2*n)

Casting de variables