login
A308343
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
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, 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, 1, 2, 1, 0, -1, -2, -3, -4, -3, -4, -3, -4, -3, -4, -5, -4
OFFSET
1,4
FORMULA
a(n) = Sum_{k = 1..n} (-1)^A038219(k).
EXAMPLE
The first terms, alongside the numbers of zeros and of ones and A038219(n), are:
n a(n) #0's #1's A038219(n)
-- ---- ---- ---- ----------
1 1 1 0 0
2 0 1 1 1
3 1 2 1 0
4 2 3 1 0
5 1 3 2 1
6 0 3 3 1
7 1 4 3 0
8 0 4 4 1
9 1 5 4 0
10 0 5 5 1
11 -1 5 6 1
12 -2 5 7 1
PROG
(Perl) See Links section.
CROSSREFS
Cf. A038219.
Sequence in context: A085004 A095774 A266874 * A331216 A071993 A317754
KEYWORD
sign
AUTHOR
Rémy Sigrist, May 21 2019
STATUS
approved