If I understood the question correctly, what you want is $$f(n)=\left(2^n+1\right)\left(2^{n-1}+1\right)$$ If you're wondering how it is obtained, I suggest you to read this.
If I understood the question correctly, what you want is $$f(n)=\left(2^n+1\right)\left(2^{n-1}+1\right)$$ If you're wondering how it is obtained, I suggest you to read this.