Solving by Substitution-
$T(2^k)=3T(2^{k-1})+1$
$=3[3T(2^{k-2})+1]+1$
$=3^2T(2^{k-2})+3+1$
.
.
.
$=3^xT(2^{k-x})+3^{x-1}+3^{x-2}+3^{x-3}.......+3^2+3^1+3^0$
now base condition is $T(1)=1$,
Therefore, $T(2^0)=1$ and we have $T(2^{k-x})$
Thus, comparing the powers, we get
$k-x=0$
$k=x$
Substituting it again in the recurrence we get-
$=3^k+3^{k-1}+3^{k-2}.......+3^2+3^1+3^0$
Now this is GP. Common ratio = 3, first term =1, total terms =k+1
Thus, $\frac{3^{k+1}-1}{2}$ --ANSWER.