Let $H_n=1+1/2+..+1/n=p_n/q_n$. Find all $n$ such that $3|p_n$ Problem: Let $H_n=1+1/2+..+1/n=p_n/q_n$ with $\gcd(p_n,q_n)=1$. Find all $n$ such that $3|p_n$.

Observations:
Note that $H_n=(n!/1+n!/2+...+n!/n)/n!$. If $3|p_n$, the numerator of this fraction must have 3-adic valuation at least $3^t$.
Let $v_3(n!)=t$, and consider the largest power of $3$ not exceeding $n$, call it $3^s$. If $i \in \{1,2,..,n\}$ and $i$ is not divisible by $3^s$, then $v_3(n!/i) \ge 3^{t-s+1}$. If $i$ is divisible by $3^s$, then $v_3(n!/i)=3^{t-s}$. 
Thus $(n!/1+n!/2+...+n!/n)$ is of the form $3^{t-s+1}a+3^{t-s}b=3^{t-s}(3a+b)$. We aren't sure if $b$ is not divisible by 3, so in order to find the 3-adic valuation of the numerator we need to take some cases.
Case I: $3^s \le n <2*3^s$
Then the only $i \in \{1,2,..,n\}$ divisible by $3^s$ is $3^s$, so $b=1$. 
Then the 3-adic valuation of the numerator is $3^{t-s}$, which must be at least $3$, so $s=0$, and no solutions here.
Case II: $2* 3^s \le n <3^{s+1}$
Then the only $i \in \{1,2,..,n\}$ divisible by $3^s$ are $3^s$ and $2*3^s$, so $b=1+2=3$. 
Then the numerator is of the form $3^{t-s}(3a+3b)$, but we don't know anything about $a$ or $b$ which tells us if $a+b$ is divisible by $3$,so we are stuck.
We can find out more information  if we consider the $i \in \{1,2,..,n\}$ divisible by $3^{s-1}$, i.e $3^{s-1},2*3^{s-1},...,6*3^{s-1}$ and possibly $7*3^{s-1}$and $8*3^{s-1}$.
For example, if you suppose that $8*3^{s-1}\le n<3^{s+1}$, then the numerator is of the form $3^{t-(s-2)}a+n!/3^{t-(s-2)}a3^{s-1}+...+n!/(8*3^{s-1})=3^{t-(s-2)}a+760*n!/(280*3^{s-1})=3^{t-(s-2)}a+3^{t-(s-1)}b=3^{t-(s-1)}(3a+b)$.
Thus $s=1$, which means $n=8$ is the only possibility for this case (it doesn't work anyways). 
There are 2 other subcases, one which gives the valid solution $n=7$, but the other has the same problem of lacking information about $a$ and $b$. So now I'm really stuck.
A computer check shows that $n=2,7,22$ are the only solutions for $n<10,000$. 
Edit: I also tried using inverses. If $i \in \{1,2,..,n\}$ and $i$ not divisible by $3$, then $i^{-1}$ (inverse of $i$ modulo $n$) is not divisible by $3$. So looking at $H_n$ modulo $3$ we can take the fractions of the form $1/i$, $i$ not divisible by $3$. Their sum is equivalent to sum of all such $i$ (the inverses of the $i$'s are a permutation of the $i$'s). This sum is $0$ if $n=0,2 \mod 3$ and $1$ otherwise. The remaining terms in $H_n$ equal to $1/3H_(\lfloor n/3 \rfloor)$. I don't think this helps.

Please let me know if my approach can be made to work, and if not please post a solution.
 A: I have found a solution using the idea from my edit in the question details. Call $n$ good if $3|p_n$. 
We can write
$H_n=(1/3)H_{\lfloor n/3 \rfloor}+(1/1+1/2+1/4+1/5+..+1/(3k+1)+1/(3k+2))$
for an appropriate $k$. The sum in the parentheses can be written
$3/1*2+9/4*5+15/7*8+..+(6k+3)/[(3k+1)*(3k+2)]$
The numerator of each fraction in this sum is divisible by 3. The denominator of each fraction is not divisible by 3. Thus the sum is of the form $3a_n/b_n$ with $\gcd(a_n,b_n)=1$ and $b_n$ not divisible by $3$.
Let $H_{\lfloor n/3 \rfloor}=p/q$ with $\gcd (p,q)=1$. Then we can write $H_n=(1/3)(p/q)+3*a_n/b_n=(pb_n+9a_nq)/(3b_nq)$. 
Note that if $p$ is not divisible by $3$, the the numerator of this fraction is not divisible by $3$, so $p_n$ is not divisible by $3$. Thus we have the following result:
If $n$ is good, then $\lfloor n/3 \rfloor$ is good.
Now suppose $3^k \le n <3^{k+1}$. Then  $3^{k-1} \le \lfloor n/3 \rfloor <3^k$. Thus if $n \in [3^k,3^{k+1})$ is good then there must be a corresponding good number in $[3^{k-1},3^k)$.
First we check $k=0$, we find only $2$ is good. For $k=1$ we only need to check $n=6,7,8$, we find only $7$ is good. For $k=2$ we only need to check $n=21,22,23$, we find only $22$ is good. For $k=3$ we only need to check $66,67,68$, we find none of them are good. Thus there are no good $n \ge 27$. 
So the only good $n$ are $2,7,22$.
Note: You can use the method I outlined in question details to do the computations at the end. I will fill in the details later.
