login
Run Length Transform of A000225.
11

%I #29 Feb 04 2022 11:18:50

%S 1,1,1,3,1,1,3,7,1,1,1,3,3,3,7,15,1,1,1,3,1,1,3,7,3,3,3,9,7,7,15,31,1,

%T 1,1,3,1,1,3,7,1,1,1,3,3,3,7,15,3,3,3,9,3,3,9,21,7,7,7,21,15,15,31,63,

%U 1,1,1,3,1,1,3,7,1,1,1,3,3,3,7,15,1,1,1,3,1,1,3,7,3,3,3,9,7,7,15,31,3,3,3,9,3,3,9,21,3,3,3,9,9,9,21,45,7,7,7,21,7,7,21,49,15,15,15,45,31,31,63,127,1

%N Run Length Transform of A000225.

%C a(n) can be also computed by replacing all consecutive runs of zeros in the binary expansion of n with * (multiplication sign), and then performing that multiplication, still in binary, after which the result is converted into decimal. See the example below.

%H Antti Karttunen, <a href="/A246674/b246674.txt">Table of n, a(n) for n = 0..8192</a>

%F For all n >= 0, a(A051179(n)) = A247282(A051179(n)) = A051179(n).

%e 115 is '1110011' in binary. The run lengths of 1-runs are 2 and 3, thus a(115) = A000225(2) * A000225(3) = ((2^2)-1) * ((2^3)-1) = 3*7 = 21.

%e The same result can be also obtained more directly, by realizing that '111' and '11' are the binary representations of 7 and 3, and 7*3 = 21.

%e From _Omar E. Pol_, Feb 15 2015: (Start)

%e Written as an irregular triangle in which row lengths are the terms of A011782:

%e 1;

%e 1;

%e 1,3;

%e 1,1,3,7;

%e 1,1,1,3,3,3,7,15;

%e 1,1,1,3,1,1,3,7,3,3,3,9,7,7,15,31;

%e 1,1,1,3,1,1,3,7,1,1,1,3,3,3,7,15,3,3,3,9,3,3,9,21,7,7,7,21,15,15,31,63;

%e ...

%e Right border gives 1 together with the positive terms of A000225.

%e (End)

%t f[n_] := 2^n - 1; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 100}] (* _Jean-François Alcover_, Jul 11 2017 *)

%o (MIT/GNU Scheme)

%o (define (A246674 n) (fold-left (lambda (a r) (* a (A000225 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))

%o (define (A000225 n) (- (A000079 n) 1))

%o (define (A000079 n) (expt 2 n))

%o ;; Other functions as in A227349.

%o (Python)

%o # uses RLT function in A278159

%o def A246674(n): return RLT(n,lambda m: 2**m-1) # _Chai Wah Wu_, Feb 04 2022

%Y Cf. A003714 (gives the positions of ones).

%Y Cf. A000225, A051179.

%Y A001316 is obtained when the same transformation is applied to A000079, the powers of two.

%Y Run Length Transforms of other sequences: A071053, A227349, A246588, A246595, A246596, A246660, A246661, A246685, A247282.

%K nonn,base

%O 0,4

%A _Antti Karttunen_, Sep 08 2014