# How could I describe a function whose domain is x>=1 for integers, starts at 3 f(1)=3, then multiplied by 2 f(2)=6, then by 3 f(3)=18, repeat

$$f(1)=3 \quad f(2)=6\quad f(3)=18\quad f(4)=36 \quad f(5)=108$$

How can I define this function? The function is recursive and multiplies by 2 then 3 alternatively. I know I could solve this in code, but I'm not sure of the mathematical terms one could use to make a function like this. Let me know if I'm not clear and thank you for any help.

• Can you please fix the title? It doesn't make any sense. – dfeuer Sep 19 '13 at 7:37
• What doesn't make sense. – Philip Rego Sep 19 '13 at 19:58

How about $f(n)=3^{\lceil n/2\rceil}\cdot 2^{\lfloor n/2\rfloor}$? Here $\lceil x\rceil$ denotes the smallest integer not less than $x$, and $\lfloor x\rfloor$ is the largest integer not greater than $x$.
• It works for integers, and f(1)=3, since $\lceil 1/2\rceil$=1 and $\lfloor 1/2\rfloor$=0. You can prove the rule is correct by induction. – primoz Sep 23 '13 at 20:18
For each $k\in\mathbb{N}$ we can express
$$\begin{array}{l l} f(2k-1)&= 3^k 2^{k-1} \\ f(2k) &= 3^k 2^k \end{array} .$$