OFFSET
0,4
LINKS
EXAMPLE
For n=12, A007088(12) = "1100" in binary, the run lengths are [2,2], thus a(12) = lcm(2,2) = 2.
PROG
(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.
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 14 2017
STATUS
approved