Results 1 to 2 of 2

Math Help - even and odd

  1. #1
    Super Member
    Joined
    Aug 2009
    Posts
    639

    even and odd

    given that g is deals only with natural numbers,
    g(0)=0
    g(1)=1
    g(n)=g(n/2) +1 when n is even and greater than 1
    g(n)= g(3n+1) +1 when n is odd and greater than 1

    what is g(23)

    i know i need to use recursion but i cant seem to get it.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,559
    Thanks
    785
    Replace n by 23 in the following.
    g(n)=g(n/2) +1 when n is even and greater than 1
    g(n)= g(3n+1) +1 when n is odd and greater than 1
    Then choose the line that has the true condition after "when". The will show that g(23) = g(x) + 1 for some number x. Repeat with x in place of 23.
    Follow Math Help Forum on Facebook and Google+

Search Tags


/mathhelpforum @mathhelpforum