[go: up one dir, main page]

login
A278161
Run length transform of A008619 (floor(n/2)+1).
4
1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 3, 3, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 2, 4, 2, 2, 4, 4, 2, 2, 2, 4, 3, 3, 3, 4, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 3, 3, 2, 2, 2, 4, 2, 2, 4, 4, 2, 2, 2, 4, 4, 4, 4, 6, 2, 2, 2, 4, 2, 2, 4, 4, 3
OFFSET
0,4
FORMULA
a(n) = A046951(A005940(1+n)), a(A156552(n)) = A046951(n).
a(n) = Sum_{k=0..n} ((binomial(n+3k,6k)*binomial(n,k)) mod 2). - Chai Wah Wu, Nov 19 2019
EXAMPLE
n=111 is "1101111" in binary, which has two runs of 1-bits: the other has length 2, and the other has length 4, thus we take the product A008619(2)*A008619(4) = (floor(2/2)+1) * (floor(4/2)+1) = 2*3, which is the result, so a(111) = 6.
MATHEMATICA
f[n_] := Floor[n/2] + 1; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 120}] (* Jean-François Alcover, Jul 11 2017 *)
PROG
(Scheme)
(define (A278161 n) (fold-left (lambda (a r) (* a (A008619 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
(define (A008619 n) (+ 1 (/ (- n (modulo n 2)) 2)))
;; See A227349 for the required other functions.
(Python)
def A278161(n): return sum(int(not (~(n+3*k) & 6*k) | (~n & k)) for k in range(n+1)) # Chai Wah Wu, Sep 28 2021
CROSSREFS
Cf. A106737, A227349 for other run length transforms, and also A278222.
Sequence in context: A362415 A317335 A014709 * A069258 A273134 A126207
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Nov 14 2016
STATUS
approved