Let $S$ be the set of positive integers $n$ such that 
\[3\cdot
 \varphi (n)=n,\]
where $\varphi (n)$ is the number of positive integers $k\leq n$ such that $\gcd (k, n)=1$. Find
\[\sum_{n\in S} \, \frac{1}{n}.\]

[i]Proposed by Nathan Ramesh

1. We start with the given equation:
   \[
   3 \cdot \varphi(n) = n
   \]
   where \(\varphi(n)\) is Euler's totient function, which counts the number of positive integers up to \(n\) that are relatively prime to \(n\).

2. Recall that for \(n\) with prime factorization \(n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k}\), Euler's totient function is given by:
   \[
   \varphi(n) = n \left(1 - \frac{1}{p_1}\right) \left(1 - \frac{1}{p_2}\right) \cdots \left(1 - \frac{1}{p_k}\right)
   \]
   Substituting this into the given equation, we get:
   \[
   3 \cdot n \left(1 - \frac{1}{p_1}\right) \left(1 - \frac{1}{p_2}\right) \cdots \left(1 - \frac{1}{p_k}\right) = n
   \]
   Dividing both sides by \(n\), we obtain:
   \[
   3 \left(1 - \frac{1}{p_1}\right) \left(1 - \frac{1}{p_2}\right) \cdots \left(1 - \frac{1}{p_k}\right) = 1
   \]
   Simplifying, we get:
   \[
   \left(1 - \frac{1}{p_1}\right) \left(1 - \frac{1}{p_2}\right) \cdots \left(1 - \frac{1}{p_k}\right) = \frac{1}{3}
   \]

3. We need to find the prime factors \(p_1, p_2, \ldots, p_k\) such that the product of \(\left(1 - \frac{1}{p_i}\right)\) equals \(\frac{1}{3}\). Let's consider the possible prime factors:
   - If \(p_1 = 2\), then \(1 - \frac{1}{2} = \frac{1}{2}\).
   - If \(p_2 = 3\), then \(1 - \frac{1}{3} = \frac{2}{3}\).

4. We check the product of these factors:
   \[
   \left(1 - \frac{1}{2}\right) \left(1 - \frac{1}{3}\right) = \frac{1}{2} \cdot \frac{2}{3} = \frac{1}{3}
   \]
   This works, so \(n\) can be of the form \(2^a \cdot 3^b\) for non-negative integers \(a\) and \(b\), where \(a \geq 1\) and \(b \geq 1\).

5. We now need to find the sum:
   \[
   \sum_{n \in S} \frac{1}{n}
   \]
   where \(S\) is the set of all \(n\) of the form \(2^a \cdot 3^b\).

6. We calculate the sum of the reciprocals:
   \[
   \sum_{a=1}^{\infty} \sum_{b=1}^{\infty} \frac{1}{2^a \cdot 3^b}
   \]
   This can be separated into two geometric series:
   \[
   \left(\sum_{a=1}^{\infty} \frac{1}{2^a}\right) \left(\sum_{b=1}^{\infty} \frac{1}{3^b}\right)
   \]

7. Each series is a geometric series with the first term \(a_1 = \frac{1}{2}\) and common ratio \(r = \frac{1}{2}\) for the first series, and \(a_1 = \frac{1}{3}\) and common ratio \(r = \frac{1}{3}\) for the second series:
   \[
   \sum_{a=1}^{\infty} \frac{1}{2^a} = \frac{\frac{1}{2}}{1 - \frac{1}{2}} = 1
   \]
   \[
   \sum_{b=1}^{\infty} \frac{1}{3^b} = \frac{\frac{1}{3}}{1 - \frac{1}{3}} = \frac{1}{2}
   \]

8. Multiplying these sums together, we get:
   \[
   1 \cdot \frac{1}{2} = \frac{1}{2}
   \]

The final answer is \(\boxed{\frac{1}{2}}\).