# Math Help - Finding a function for a table

1. ## Finding a function for a table

I have tried to find just one function for this table and cannot. I have tried adding, subtracting, multiplying, dividing and exponential. This is my son's 5th grade math question and I am being dense. Can you please help me find a formula?
Input Output
3 21
6 42
9 27
12 36

Thank you!!

2. ## Re: Finding a function for a table

Originally Posted by pj389
I have tried to find just one function for this table and cannot. I have tried adding, subtracting, multiplying, dividing and exponential. This is my son's 5th grade math question and I am being dense. Can you please help me find a formula?
Input Output
3 21
6 42
9 27
12 36

Thank you!!
$f(3n) =\begin{cases}21\cdot n, & \text{if }n \in \{1,2\} \\9 \cdot n, & \text{if }n \in \{3,4\}\end{cases}$