# 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. Sep 19 '13 at 7:37
• What doesn't make sense. 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$.

• What do you mean by smallest and largest integer. This function works for the even numbers, but I'm not sure what that notation is. Sep 19 '13 at 8:25
• @PhilipRego The notation is for the floor and ceiling functions. You can think of it as rounding up (for ceiling) and (down) for floor to the nearest integer. For example, the floor of 2.5 (the largest integer not greater than 2.5) is 2. The floor of 7 is 7.
– Mike
Sep 19 '13 at 9:06
• Sep 19 '13 at 9:15
• This only needs to work for integers. And it doesn't work for the odd numbers f(1) doesn't equal 3 Sep 19 '13 at 20:00
• 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. 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} .$$