login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1, a(n) = floor(n*Sum_{k=1..n-1} a(k)/2^k - Sum_{k=1..n-1} a(k)) for n > 1.
0

%I #20 Apr 01 2017 17:27:30

%S 1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,

%T 0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,

%U 0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1

%N a(1) = 1, a(n) = floor(n*Sum_{k=1..n-1} a(k)/2^k - Sum_{k=1..n-1} a(k)) for n > 1.

%C The mean density of ones in the sequence converges to a limit C, and the binary expansion of C is the sequence itself.

%C Let s(n) = Sum_{k=1..n} a(k), c(n) = Sum_{k=1..n} a(k)/2^k, and d(n) = s(n)/n.

%C By definition, s(n) = floor(n*c(n-1)) for n > 1.

%C We can show by induction that a(n) always equals 0 or 1.

%C Hence, c(n) converges to some limit C as n goes to infinity.

%C Also, d(n) = floor(n*c(n-1))/n ~ floor(n*C)/n ~ C as n goes to infinity (QED).

%C C = 0.58870955436366549427...

%C This constant C cannot be rational: the mean density of ones in the binary representation of a rational number u/v (with 0 < u < v and gcd(u,v) = 1) can be written as u'/v' with 0 < u' < v' and v' = A007733(v); as v' <= phi(v) < v, u/v never equals u'/v'.

%C Let b be the eventually periodic sequence with pre-period b(1)..b(14) = a(1)..a(14), and period 124 given by a(15)..a(138). The mean density of ones in b is the rational number 73/124 = 0.58870967... Of course, a and b cannot be equal, but a(n) = b(n) for all n < 65614. - _Michel Dekking_, Mar 30 2017

%t a[1] := 1; a[n_] := Floor[n*Sum[(a[k]/2^k), {k, 1, n - 1}]] - Sum[a[k], {k, 1, n - 1}]; Table[a[n], {n, 1, 10}] (* _G. C. Greubel_, Oct 17 2016 *)

%o (PARI) s=0; c=0; for (n=1, 100, a=if(n==1, 1, floor(n*c)-s); print1(a", "); s=s+a; c=c+a/2^n)

%Y Cf. A007733, A275973.

%K nonn,base,cons

%O 1

%A _Rémy Sigrist_, Oct 16 2016