Consider the finite cyclic group $\mathbb Z_{150}$. Consider the cyclic subgroup generated by $[5]$ which is $\langle[5]\rangle=\{[5],[10],[15],\ldots ,[145],[0]\}$ . Find the number of those $[a]\in \langle[5]\rangle$ such that $\gcd(a,6)=1$
My try
I know $150=2.3.5^2$. Now if I write in explicitly in hand, I found set of all $a$ such that $\gcd(a,6)=1$ to be the following set:
$\{5,25,35,55,65,85,95,115,125,145\}$.
Is there any explicit formula to calculate the above?
I will be grateful for some help.
In general my question is :
If $n=\prod_{i=1}^k p_i^{\alpha_i}$ what will be the number of those $[a]\in \langle p_k\rangle $ such that $\gcd(a,p_1p_2\cdots p_{k-1})=1$?