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.

A284559 a(n) = LCM of run lengths in binary representation of n.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 3, 6, 2, 2, 2, 6, 3, 4, 5, 5, 4, 3, 6, 2, 2, 2, 6, 3, 2, 1, 2, 2, 2, 3, 4, 4, 6, 2, 2, 2, 2, 2, 6, 3, 6, 3, 6, 4, 4, 5, 6, 6, 5, 4, 4, 6, 3, 6, 3, 6, 2, 2, 2, 2, 2, 6, 4, 4, 3, 2, 2, 2, 1, 2, 3, 6, 2, 2, 2, 6, 3, 4, 5, 10, 4, 6, 6, 2, 2, 2, 6, 6, 2, 2, 2, 2, 2, 6, 4, 12, 3, 6, 6, 6, 3, 6, 3
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2017

Keywords

Examples

			For n=12, A007088(12) = "1100" in binary, the run lengths are [2,2], thus a(12) = lcm(2,2) = 2.
		

Crossrefs

Cf. A000975 (positions of ones).

Programs

  • Python
    from math import lcm
    from itertools import groupby
    def a(n): return lcm(*(len(list(g)) for k, g in groupby(bin(n)[2:])))
    print([a(n) for n in range(87)]) # Michael S. Branicky, Oct 15 2022
  • Scheme
    (define (A284559 n) (apply lcm (binexp->runcount1list n)))
    ;; Or:
    (define (A284559 n) (reduce lcm 1 (binexp->runcount1list n))) ;; For binexp->runcount1list, see the Program section of A227349.
    

Formula

a(n) = A167489(n) / A284558(n).