login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A093476 Index of occurrence of the first 0 bit in binary representation of 3^n. 1
2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 6, 2, 2, 3, 2, 4, 2, 2, 3, 2, 4, 2, 7, 2, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2, 3, 2, 3, 2, 6, 2, 2, 3, 2, 4, 2, 2, 3, 2, 4, 2, 7, 2, 2, 3, 2, 5, 2, 2, 3, 2, 4, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
LINKS
FORMULA
It seems that Sum_{i=2..n} a(i) is asymptotic to c*n with c=2.7(8).....
From Robert Israel, Nov 20 2017: (Start)
a(n) = k if log_2(2 - 1/2^(k-2)) < frac(n*log_2(3)) < log_2(2 - 1/2^(k-1)). By the equidistribution theorem, this occurs with asymptotic density log_2(2-1/2^(k-1)) - log_2(2-1/2^(k-2)).
Thus c = Sum_{k>=2} k (log_2(2-1/2^(k-1)) - log_2(2 - 1/2^(k-2))) = 2 - Sum_{k>=2} log_2(1-1/2^k) = 2.791916824662... Note that A048651 is the decimal expansion of 2^(1-c). (End)
EXAMPLE
In binary, 3^5 = [1, 1, 1, 1, 0, 0, 1, 1] where the first 0 occurs at 5th place. Hence a(5)=5.
MAPLE
seq(ListTools:-Search(0, ListTools:-Reverse(convert(3^n, base, 2))), n=2..200); # Robert Israel, Nov 20 2017
MATHEMATICA
Array[FirstPosition[IntegerDigits[3^#, 2], 0][[1]] &, 105, 2] (* Michael De Vlieger, Nov 20 2017 *)
PROG
(PARI) a(n)=if(n<2, 0, s=1; while(component(binary(3^n), s)>0, s++); s)
CROSSREFS
Sequence in context: A124386 A098668 A112763 * A262597 A217607 A066727
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 22 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 29 04:57 EDT 2024. Contains 372097 sequences. (Running on oeis4.)