This is similar to having multiplication in complex numbers
$$(x+yi)(u+vi)=(xu-yv)+(xv+yu)i$$ Just instead of imaginary $i$ you have $\sqrt{3}$. So
$$(x+y\sqrt{3})(u+v\sqrt{3})=(xu+3yv)+(xv+yu)\sqrt{3}$$
Now basically abstracting this idea to pairs of integers, you have
$$(x,y)\cdot(u,v)=(xu+3yv,xv+yu)$$
Using this "$\cdot$" $n$ times correctly (actually $n-1$ times), you can calculate $n$-th power of a number. Notice that there are only basic arithmetic operations involved.
Efficience
Since you wanted also efficient algorithm, you can speed this up by using fast exponentiation. Basic idea is that instead of calculating $x$,$x^2$,$x^3$,etc, you just calculate
\begin{align}
x^2 &= x \cdot x \\
x^4 &= x^2 \cdot x^2 \\
x^8 &= x^4 \cdot x^4 \\
&\vdots \\
\end{align}
and then combine the results correctly. This results on average in $\log_2{n}$ multiplication steps as compared to $n$ steps when using naive approach. There are other tricks to speed exponentiation up, suggest you to check them Fast exponentiation algorithm - How to arrive at it?, https://en.wikipedia.org/wiki/Exponentiation_by_squaring.
Algorithm Pseudocode
To be even more specific, lets construct one such algorithm. Let's pick for example this fast exponentiation algorithm:
Function exp-by-squaring(x, n)
if n = 0 then return 1;
else if n is even then return exp-by-squaring(x * x, n / 2);
else if n is odd then return x * exp-by-squaring(x * x, (n - 1) / 2);
Now replacing $x$ with pair of numbers $a,b$, and similarly the multiplication with the one described above, we get:
Function exp-by-squaring(a, b, n)
if n = 0 then return (1,0);
else if n is even then return exp-by-squaring(a*a+3b*b, 2ab, n / 2);
else if n is odd then
(c,d) = exp-by-squaring(a*a+3b*b, 2ab, (n - 1) / 2);
return (ac+3bd,ad+bc);
This by the way shows how you can calculate powers in general, you just need to have multiplication defined. Even in cases where it first looks like the problem is only solvable by recursions, this trick allows to skip many steps.
Python example
Now if you turn this into python (or any programming language you like), you can play with it:
def exp(a, b, n):
if n == 0:
return (1,0)
elif n % 2 == 0:
return exp(a*a+3*b*b, 2*a*b, n / 2)
elif n % 2 == 1:
(c,d) = exp(a*a+3*b*b, 2*a*b, (n - 1) / 2)
return (a*c+3*b*d,a*d+b*c)
For example
print exp(1,1,20)
yields
(268377088, 154947584)
And indeed, $(1+\sqrt{3})^{20} = 268377088+154947584\sqrt{3}$
Also notice there were only $5$ multiplications done, compared to naive $19$:
\begin{align}
(1+\sqrt{3})^2 &= (1+\sqrt{3}) \cdot (1+\sqrt{3})\\
(1+\sqrt{3})^4 &= (1+\sqrt{3})^2 \cdot (1+\sqrt{3})^2\\
(1+\sqrt{3})^8 &= (1+\sqrt{3})^4 \cdot (1+\sqrt{3})^4\\
(1+\sqrt{3})^{16} &= (1+\sqrt{3})^8 \cdot (1+\sqrt{3})^8\\
(1+\sqrt{3})^{20} &= (1+\sqrt{3})^4 \cdot (1+\sqrt{3})^{16}\\
\end{align}