%I #27 Jul 16 2023 02:08:01
%S 0,0,0,1,1,1,2,3,3,3,3,4,5,5,6,7,7,7,7,8,8,8,9,10,11,11,11,12,13,13,
%T 14,15,15,15,15,16,16,16,17,18,18,18,18,19,20,20,21,22,23,23,23,24,24,
%U 24,25,26,27,27,27,28,29,29,30,31,31,31,31,32,32,32,33,34,34,34,34,35
%N (1/2)*(n minus number of runs in the binary expansion of n): a(n) = (n - A005811(n)) / 2 = A236840(n)/2.
%H Antti Karttunen, <a href="/A255070/b255070.txt">Table of n, a(n) for n = 0..8192</a>
%H Helmut Prodinger and Friedrich J. Urbanek, <a href="https://doi.org/10.1016/0012-365X(79)90135-3">Infinite 0-1-Sequences Without Long Adjacent Identical Blocks</a>, Discrete Mathematics, Volume 28, Number 3, 1979, pages 277-289. Also <a href="http://finanz.math.tugraz.at/~prodinger/pdffiles/long_adjacent.pdf">first author's copy</a>. See theorem 3.6, n_1(k) = a(k).
%F a(n) = A236840(n) / 2 = (n - A005811(n)) / 2.
%F Other identities:
%F a(A091067(n)) = n for all n >= 1.
%F a(A255068(n)) = n for all n >= 0.
%F a(A269363(n)) = A269367(n). - _Antti Karttunen_, Aug 12 2019
%t a[n_] := (n - Length@ Split[IntegerDigits[n, 2]])/2; a[0] = 0; Array[a, 100, 0] (* _Amiram Eldar_, Jul 16 2023 *)
%o (Scheme) (define (A255070 n) (/ (A236840 n) 2))
%Y Least inverse: A091067 (also the positions of records).
%Y Greatest inverse: A255068.
%Y Run lengths: A106836.
%Y Cf. A005811, A060833, A236840, A255054, A255056, A255072, A269363, A269367.
%K nonn,base
%O 0,7
%A _Antti Karttunen_, Feb 14 2015