Results 1 to 2 of 2

Math Help - matlab code sequences

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    11

    matlab code sequences

    he following iterative sequence is defined for the set of positive integers: n n/2 (n is even)
    n 3n + 1 (n is odd)
    Using the rule above and starting with 13, we generate the following sequence:
    13 40 20 10 5 16 8 4 2 1
    It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.
    Which starting number, under one million, produces the longest chain?




    i need the matlab code for this ??
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by savni98 View Post
    he following iterative sequence is defined for the set of positive integers: n n/2 (n is even)
    n 3n + 1 (n is odd)
    Using the rule above and starting with 13, we generate the following sequence:

    13 40 20 10 5 16 8 4 2 1

    It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.
    Which starting number, under one million, produces the longest chain?




    i need the matlab code for this ??
    You need to tell us what you have done and where you are having difficulties, we are not here to present you with finished solutions to hand in.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab code
    Posted in the Math Software Forum
    Replies: 2
    Last Post: April 4th 2011, 03:18 AM
  2. MATLAB code
    Posted in the Calculus Forum
    Replies: 0
    Last Post: November 5th 2009, 06:44 AM
  3. matlab code helpppp :(
    Posted in the Math Software Forum
    Replies: 3
    Last Post: October 20th 2009, 01:06 AM
  4. Need MAtlab code
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 26th 2009, 10:57 PM
  5. Need to do this by matlab code emengercy please help
    Posted in the Advanced Applied Math Forum
    Replies: 0
    Last Post: April 7th 2008, 07:30 PM

Search Tags


/mathhelpforum @mathhelpforum