login
a(n) is the difference between the number of zeros and the number of ones among the first n terms of the Ehrenfeucht-Mycielski sequence A038219.
1

%I #11 May 22 2019 03:36:07

%S 1,0,1,2,1,0,1,0,1,0,-1,-2,-1,0,1,0,1,2,3,4,3,2,1,0,1,0,-1,0,1,0,1,0,

%T 1,2,1,2,3,2,1,0,1,0,1,2,3,2,1,2,3,4,5,6,5,6,5,4,5,4,3,2,1,0,1,2,1,0,

%U 1,2,1,0,-1,-2,-3,-4,-3,-4,-3,-4,-3,-4,-5,-4

%N a(n) is the difference between the number of zeros and the number of ones among the first n terms of the Ehrenfeucht-Mycielski sequence A038219.

%H Rémy Sigrist, <a href="/A308343/b308343.txt">Table of n, a(n) for n = 1..10000</a>

%H Rémy Sigrist, <a href="/A308343/a308343.png">Scatterplot of the first 500000 terms</a>

%H Rémy Sigrist, <a href="/A308343/a308343.pl.txt">Perl program for A308343</a>

%F a(n) = Sum_{k = 1..n} (-1)^A038219(k).

%e The first terms, alongside the numbers of zeros and of ones and A038219(n), are:

%e n a(n) #0's #1's A038219(n)

%e -- ---- ---- ---- ----------

%e 1 1 1 0 0

%e 2 0 1 1 1

%e 3 1 2 1 0

%e 4 2 3 1 0

%e 5 1 3 2 1

%e 6 0 3 3 1

%e 7 1 4 3 0

%e 8 0 4 4 1

%e 9 1 5 4 0

%e 10 0 5 5 1

%e 11 -1 5 6 1

%e 12 -2 5 7 1

%o (Perl) See Links section.

%Y Cf. A038219.

%K sign

%O 1,4

%A _Rémy Sigrist_, May 21 2019