Results 1 to 8 of 8

Thread: help in my sequence

  1. #1
    Member
    Joined
    Jun 2010
    From
    Zewail University - Cairo - Egypt
    Posts
    142

    help in my sequence

    (2,4,8,16,32,64,128,256,512,1024,......)

    if i have a number i want to know if it is in the sequence or not
    but i don't want the way which i will divide the number by 2 till i found it 2 or not i want a function from one or two steps to know if this number is from sequence or not
    Follow Math Help Forum on Facebook and Google+

  2. #2
    -1
    e^(i*pi)'s Avatar
    Joined
    Feb 2009
    From
    West Midlands, England
    Posts
    3,053
    Thanks
    1
    Take the log using base 2. If the answer is an integer than your number is in the sequence
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Jun 2010
    From
    Zewail University - Cairo - Egypt
    Posts
    142
    Quote Originally Posted by e^(i*pi) View Post
    Take the log using base 2. If the answer is an integer than your number is in the sequence
    thx but what meant by log
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Aug 2006
    Posts
    20,419
    Thanks
    2305
    Awards
    1
    Look at 2^n.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    -1
    e^(i*pi)'s Avatar
    Joined
    Feb 2009
    From
    West Midlands, England
    Posts
    3,053
    Thanks
    1
    Your sequences is u_n = 2^n. By log I mean logarithm which is the inverse of exponentiation. \log_2(x) = \log_2(2^n) = n where x is the number you're wondering whether or not is in sequence
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member
    Joined
    Jun 2010
    From
    Zewail University - Cairo - Egypt
    Posts
    142
    thx this will help me alot
    thx also plato but i think the second method is easier
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor

    Joined
    Apr 2005
    Posts
    18,439
    Thanks
    2528
    That's very strange! You say that you do not know what a logarithm is but you think it will be easier to take the logarithm?

    If you really do not know about logarithms (especially taking the logarithm, base 2) I would recommend repeatedly dividing by 2. If you eventually arrive at 1 without any fractions, the number is a power of 2.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Member
    Joined
    Jun 2010
    From
    Zewail University - Cairo - Egypt
    Posts
    142
    Quote Originally Posted by HallsofIvy View Post
    That's very strange! You say that you do not know what a logarithm is but you think it will be easier to take the logarithm?

    If you really do not know about logarithms (especially taking the logarithm, base 2) I would recommend repeatedly dividing by 2. If you eventually arrive at 1 without any fractions, the number is a power of 2.
    i searched for lagorithm and learned it thx very much
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: Aug 24th 2010, 03:10 AM
  2. Replies: 0
    Last Post: Jul 4th 2010, 01:05 PM
  3. Replies: 2
    Last Post: Mar 1st 2010, 12:57 PM
  4. sequence membership and sequence builder operators
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: Jun 4th 2009, 04:16 AM
  5. Replies: 12
    Last Post: Nov 15th 2006, 01:51 PM

/mathhelpforum @mathhelpforum