As others have stated, this is not necessarily the case, but there is a general formula for the Euler function:
Given the prime factorization of some number $n = p_1^{t_1}p_2^{t_2} \cdots p_r^{t_r}$ ($n \in \mathbb{N}$), the number of relatively prime numbers to $n$ is $$ \varphi(n) = n \cdot p_1^{t_1 - 1}(p_1 - 1)p_2^{t_2 - 1}(p_2 - 2) \cdots p_r^{t_r - 1}(p_r - 1) = n \cdot \left(1 - \dfrac{1}{p_1}\right) \left(1 - \dfrac{1}{p_2}\right) \cdots \left(1 -\dfrac{1}{p_r} \right)$$
More on this formula and some of its proofs can be found at the following sites:
https://en.wikipedia.org/wiki/Euler%27s_totient_function
https://faculty.etsu.edu/gardnerr/3000/notes-MR/Gerstein-6-6.pdf
https://www.math.cmu.edu/~af1p/Teaching/Combinatorics/F03/Class17.pdf
, but I think it's an interesting function, so I will walk through the proof as well.
Proof:
In this proof, we will utilize the principle of inclusion-exclusion and consider the numbers not relatively prime to $n$. So $$C = \{ k \in \{1,...,n\} : gcd(n, k) = 1\}$$ $(k < m)$ is the set of all numbers relatively prime to $n$ and we'll let $$\overline{C} = \{ k \in \{1,...,n\} : gcd(n, k) \neq 1\}$$ be the complement of $C$ meaning in consists of all numbers not relatively prime to $n$.
By the prime factorization theorem, we know $n$ has a unique prime factorization, $n = p_1^{t_1}p_2^{t_2} \cdots p_r^{t_r}$. If some natural number $k$ less than or equal $n$ is not relatively prime to $n$, then $gcd(n, k) \neq 1$ and it is a multiple of at least one prime number $p_i$ in the prime factorization of $n$ (otherwise, the number could not be less than $n$).
We will now define $$\overline{C}_i = \{k \in \{1,...,n\} : p_i \mid k\}$$ $(i \in \{1, ...,r\}$ such that $\overline{C} = \overline{C}_1 \cup \overline{C}_2 \cup \cdots \cup \overline{C}_r$. In other words, $\overline{C}_i$ is the set of all multiples of $p_i$ less than or equal to $n$, and the cardinality of this set is $\dfrac{n}{p_i}$ (we know $\dfrac{n}{p_i} \in \mathbb{N}$ because $p_i$ is in the prime factorization of $n$). Let's extend this logic to an arbitrary intersection: $$\overline{C}_{i_1} \cap \overline{C}_{i_2} \cap \cdots \cap \overline{C}_{i_k} = \{ k \in \{1, ..., n\} : p_{i_1}p_{i_2} \cdots p_{i_k} \mid n\}\: (i_j \in \{1,...,n\}, j \in \{1,...,k\}, \text{ and } k \leq r)$$ The interpretation of this intersection is the set of numbers divisible by the primes $p_{i_1}, p_{i_2}, ..., p_{i_k}$. Thus, $$| \overline{C}_{i_1} \cap \overline{C}_{i_2} \cap \cdots \cap \overline{C}_{i_k} | = \dfrac{n}{p_{i_1}p_{i_2} \cdots p_{i_k}}$$.
Now, to find the total number of natural numbers relatively prime to $n$ we'll want to subtract the total number of natural numbers not relatively prime to $n$ from the total number of natural numbers less than or equal to $n$ (which is just $n$). But to obtain the number of natural numbers not relatively prime to $n$, we cannot simply sum together the sizes of the previously defined arbitrary intersections, though, because there is some overlap between them (an integer can appear in several arbitrary intersections given that it has more than one prime number in its prime factorization). Instead, we need $|\overline{C}_1 \cup \overline{C}_2 \cup \cdots \cup \overline{C}_r|$, which we obtain through the principle of inclusion-exclusion:
$$ \begin{align*}
\varphi (n) = |C| = n - |\overline{C}_1 \cup \overline{C}_2 \cup \cdots \cup \overline{C}_r | &= n - \displaystyle\sum_{k = 1}^r (-1)^{k - 1} \displaystyle\sum_{I \in {\{1, ..., r\} \choose k}} \left\lvert \bigcap_{i \in I} \overline{C}_i \right\rvert\\
&= n - \displaystyle\sum_{\emptyset \neq I \subseteq \{1,...,r\}} (-1)^{|I| - 1} \left\lvert \bigcap_{i \in I} \overline{C}_i \right\rvert\\
\text{(distribute -1)}\:\: &= n + \displaystyle\sum_{\emptyset \neq I \subseteq \{1,...,r\}} (-1)^{|I|} \left\lvert \bigcap_{i \in I} \overline{C}_i \right\rvert\\
\text{(substitute formula for size of arbitrary intersection)} &= n + \displaystyle\sum_{\emptyset \neq I \subseteq \{1,...,r\}} (-1)^{|I|} \dfrac{n}{\displaystyle\prod_{i \in I} p_i}\\
&= n \cdot (1 + \displaystyle\sum_{\emptyset \neq I \subseteq \{1,...,r\}} (-1)^{|I|} \dfrac{1}{\displaystyle\prod_{i \in I} p_i}\\
\left( \dfrac{1}{\displaystyle\prod_{i \in I} p_i} \text{is 1 for } I = \emptyset \right) \: \: &= n \cdot \displaystyle\sum_{I \subseteq \{1,...,r\}} (-1)^{|I|} \dfrac{1}{\displaystyle\prod_{i \in I} p_i}\\
&= n \left(1 - \dfrac{1}{p_1} \right)\left(1 - \dfrac{1}{p_2} \right) \cdots \left(1 - \dfrac{1}{p_r} \right)\\
\end{align*} $$
The last step uses the following identity when $x_i = -\dfrac{1}{p_i}$:
$$(1 + x_1)(1 + x_2) \cdots (1 + x_n) = \displaystyle\sum_{I \subseteq \{1,2,...,n\}} \displaystyle\prod_{i \in I} x_i$$