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!)
A070972 Length of longest run of consecutive 1's in binary expansion of 3^n (A004656). 0
1, 2, 1, 2, 1, 4, 2, 2, 2, 3, 3, 7, 6, 4, 5, 4, 3, 4, 4, 4, 6, 5, 5, 4, 3, 2, 10, 8, 7, 5, 4, 5, 7, 9, 8, 6, 5, 7, 11, 10, 8, 6, 6, 4, 9, 7, 6, 4, 9, 8, 6, 9, 8, 6, 5, 5, 3, 4, 7, 5, 10, 8, 7, 6, 6, 6, 6, 4, 4, 7, 7, 5, 5, 5, 5, 5, 5, 9, 8, 6, 5, 6, 5, 6, 5, 5, 4, 6, 5, 10, 8, 7, 5, 6, 6, 6, 7, 7, 6, 7, 5, 5, 5, 9 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
EXAMPLE
3^11 = (101011001111111011) binary, so a(11) = 7.
MATHEMATICA
f[n_Integer] := Block[{p = Flatten[ Position[ Prepend[ IntegerDigits[2*3^n, 2], 0], 0]]}, Max[Drop[p, 1] - Drop[p, -1]] - 1]; Table[ f[n], {n, 0, 103}]
CROSSREFS
Cf. A004656 and A011754.
Sequence in context: A349137 A284289 A111588 * A180229 A356230 A304576
KEYWORD
base,easy,nonn
AUTHOR
Frank Schwellinger (nummer_eins(AT)web.de), Jan 03 2003
EXTENSIONS
Edited by Robert G. Wilson v, Jan 04 2002
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 May 10 05:27 EDT 2024. Contains 372356 sequences. (Running on oeis4.)