# help in my sequence

• February 8th 2011, 11:34 AM
mido22
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
• February 8th 2011, 11:38 AM
e^(i*pi)
Take the log using base 2. If the answer is an integer than your number is in the sequence
• February 8th 2011, 11:46 AM
mido22
Quote:

Originally Posted by e^(i*pi)
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
• February 8th 2011, 11:50 AM
Plato
Look at $2^n$.
• February 8th 2011, 11:50 AM
e^(i*pi)
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
• February 8th 2011, 11:53 AM
mido22
thx this will help me alot
thx also plato but i think the second method is easier
• February 9th 2011, 03:57 AM
HallsofIvy
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.
• February 9th 2011, 04:20 AM
mido22
Quote:

Originally Posted by HallsofIvy
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