Also equal to floor((3^n+1)/(3n-1)). [Proof: 3^n (mod 3n-1) is never zero; therefore 3^n -(3^n (mod 3n-1)) equals (1+3^n)-((1+3^n) mod (3n-1)), and removing the remainders in the numerator of either 1+3^n or 3^n results in the same number. The proof that 3^n <> 0 (mod 3n-1) follows from assuming that 3^n=k*(3n-1) for some integer k; reading this requirement mod 3 induces k=3*k', so 3^n=3*k'*(3n-1); reading this mod 9 induces k'=3*k'' etc. ad infinitum through all powers of 3, and forcing k->infinity.] - R. J. Mathar, Jun 20 2011