Results 1 to 6 of 6

Math Help - create math formula

  1. #1
    Junior Member
    Joined
    Nov 2008
    Posts
    50

    create math formula

    if n=1 then the formula answer is:0
    if n=2 or n=3 or n=4 then the formula answer is:1
    if n=5 or n=6 or.........or n=13 then the formula answer is:2
    if n=14 or n=15 or.........or n=40 then the formula answer is:3
    and so on.....
    someone can help me to build the formula that makes thos calculations???
    Last edited by tukilala; March 24th 2009 at 04:45 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,814
    Thanks
    703
    Hello, tukilala!

    Could there be typos in the problem?



    . . \begin{array}{|c|c|}\hline<br />
n & f(n) \\ \hline<br />
1 & 0 \\<br />
2,3,4 & 1 \\<br />
5,6,\hdots,14 & 2 \\<br />
15,16,\hdots,42 & 3 \\<br />
\vdots & \vdots \end{array}

    Can someone help me to build the formula?
    I find no discernable pattern in the numbers.


    . . \begin{array}{|c|c|} \hline<br />
\text{First term} & \text{No. of terms} \\ \hline<br />
1 & 1 \\<br />
2 & 3 \\<br />
5 & 10 \\<br />
15 & 28 \\<br />
\vdots & \vdots \\<br />
? & ? \end{array}


    Follow Math Help Forum on Facebook and Google+

  3. #3
    Super Member
    Joined
    Jan 2009
    Posts
    591
    Can you supply the next two groups?

    A formula is not easy.

    An algorithm is very easy to construct.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Junior Member
    Joined
    Nov 2008
    Posts
    50
    you have a mistake....

    first term no. of terms
    1 1
    3 3
    5 9
    14 27
    . .
    . .
    . .
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Grandad's Avatar
    Joined
    Dec 2008
    From
    South Coast of England
    Posts
    2,570
    Thanks
    1
    Hello tukilala
    Quote Originally Posted by tukilala View Post
    if n=1 then the formula answer is:0
    if n=2 or n=3 or n=4 then the formula answer is:1
    if n=5 or n=6 or.........or n=13 then the formula answer is:2
    if n=14 or n=15 or.........or n=40 then the formula answer is:3
    if n=41 or ............ or n=121 then the formula answer is:4
    if n=122 or ..... n=364 then the formula is:5
    and so on....
    someone can help me to build the formula that makes thos calculations???
    The key to this is to find a formula to find the first term in each of the original groups; that is 1, 2, 5, 14, 41, .... The consecutive differences are 1, 3, 9, 27, 81, ... which are, of course, powers of 3.

    So if we try a formula of the type a_n = 3^na + b, we shall probably be OK.

    n=1: a_1 = 1 = 3a+b

    n+2: a_2 = 2 = 9a + b

    \Rightarrow a = \tfrac{1}{6}, b = \tfrac{1}{2}

    \Rightarrow a_n=3^n\times\tfrac{1}{6}+\tfrac{1}{2}

    You'll find that this formula generates the numbers that start each group: 1, 2, 5, 14, ... (Don't worry about the remaining numbers in each group: we'll deal with those later.)

    Now, how can we use this function to generate the numbers 1, 2, 3, 4, ...?

    The answer is, of course, to find the inverse function; that is, to make n the subject of the formula:

    a_n=3^n\times\tfrac{1}{6}+\tfrac{1}{2}

    Multiply both sides by 6:

    6a_n = 3^n + 3

    \Rightarrow 3^n = 6a_n-3 = 3(2a_n -1)

    Now the tricky bit: take logs to base 3 of both sides:

    \log_33^n = \log_33(2a_n -1)

    \Rightarrow n = \log_33 + \log_3(2a_n-1)= 1 + \log_3(2a_n-1)

    So there's our formula that will work for the first number in each group. Try it out.

    a_1=1: 1 + \log_31 = 1 + 0 = 1

    a_2=2: 1 + \log_33 = 1 + 1 = 2

    a_3=5: 1 + \log_3 9 = 1+2 = 3

    ... and so on.

    OK. So, finally, what do we do about the remaining numbers in each group? Well, when we use the formula above with any of the other numbers in the group, the \log_3 bit will give us the whole number that we want, with an extra decimal bit as well. All we need to do is to use the floor function, \lfloor...\rfloor, to ignore the decimal part, and just return the integer part.

    So, finally (replacing our a_n with the n referred to in the original question) the function is:

    f(n) =1 + \lfloor\log_3(2n-1)\rfloor

    (If you want to use a calculator or a spreadsheet to check this out and you don't know how to handle \log_3, you can use the formula \log_3x = \frac{\log x}{\log 3}, where \log x is log to base 10 of x.)

    Grandad
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,814
    Thanks
    703
    Hello, tukilala!

    You gave us more terms this time . . .



    . . \begin{array}{|c|c|} \hline<br />
n & f(n) \\ \hline<br />
1 & 0 \\<br />
2,3,4 & 1 \\<br />
5,6,\hdots,13 & 2 \\<br />
14,15,\hdots, 40 & 3 \\<br />
41,42,\hdots, 121 & 4 \\<br />
122,123,\hdots, 364 & 5 \\<br />
\vdots & \vdots  \end{array} . Table 1

    Can someone help me to build the formula?
    I can't find a neat formula . . .


    I examined the first term of each sequence and the number of terms.

    . . \begin{array}{|c|c|} \hline<br />
\text{First term} & \text{No. of terms} \\ \hline<br />
 1 & 1 \\ 2 & 3 \\ 5 & 9 \\ 14 & 27 \\ 41 & 81 \\ 122 & 243 \\ \vdots & \vdots \end{array} . Obviously, it involves powers-of-3.


    The k^{th} row of Table 1 would have:

    . . The numbers from \frac{3^{k-1}+1}{2}\:\text{ to }\:\frac{3^k-1}{2}\,\text{ all correspond to the value }k-1


    And that's the best I can do . . .

    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. How to create a formula
    Posted in the Algebra Forum
    Replies: 4
    Last Post: July 28th 2011, 11:57 AM
  2. Replies: 5
    Last Post: June 1st 2011, 06:52 PM
  3. Math Formula?
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: January 18th 2011, 06:39 PM
  4. I need to create some math problems...
    Posted in the Algebra Forum
    Replies: 3
    Last Post: September 13th 2009, 07:28 AM
  5. Create/Solve Probability Formula, Using values 1-50
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: July 30th 2008, 02:51 PM

Search Tags


/mathhelpforum @mathhelpforum