cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070972 Length of longest run of consecutive 1's in binary expansion of 3^n (A004656).

Original entry on oeis.org

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
Offset: 0

Views

Author

Frank Schwellinger (nummer_eins(AT)web.de), Jan 03 2003

Keywords

Examples

			3^11 = (101011001111111011) binary, so a(11) = 7.
		

Crossrefs

Cf. A004656 and A011754.

Programs

  • 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}]

Extensions

Edited by Robert G. Wilson v, Jan 04 2002