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, 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
Keywords
Examples
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Scatterplot of the first 500000 terms
- Rémy Sigrist, Perl program for A308343
Crossrefs
Cf. A038219.
Programs
-
Perl
See Links section.
Formula
a(n) = Sum_{k = 1..n} (-1)^A038219(k).