I recently asked this [question on Math.StackExchange](https://math.stackexchange.com/questions/684079/modular-form-on-gamma-0n) with no answer so far. So I thought maybe I can find an answer here.


Let $M(k,\Gamma\_0(N))$ be a space of modular forms of weight $k$ on $\Gamma\_0(N)$.
Each $f \in M(k,\Gamma\_0(N))$ has a Fourier expansion of the form
$$ f(\tau)=\sum\_{n\in \mathbb{N}}a(n)\,q^n \quad \text{where}\quad q=\mathrm{e}^{2\pi \mathrm{i}\tau} . $$


Now, let $g(\tau)$ be a function obtained from $f(\tau)$ by omitting all $a(n)$ such that $\gcd(n,N)\neq 1$, i.e.
$$ g(\tau)=\sum\_{\substack{n\in \mathbb{N}\\(n,N)=1}}a(n)\,q^n . $$


**Question:** Is $g(\tau)$ a modular form? What is its level?


Many thanks.



Modular form on $\Gamma_0(N)$
$$ g(\tau)=f(\tau)\otimes \left(\tfrac{N^2}{\cdot}\right)=\sum\_{n\in \mathbb{N}}\left(\tfrac{N^2}{n}\right)a(n)\,q^n \quad \text{where}\left(\tfrac{N^2}{\cdot}\right) \text{ is the Kronecker symbol}.$$
This means that $g(\tau)$ is just the twist of $f(\tau)$ by a principle character. Indeed we have $$g(\tau)\in M(k,\Gamma\_0(N^3)).$$ 


