A054354
First differences of Kolakoski sequence A000002.
Original entry on oeis.org
1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 0, 1, 0, -1, 1, -1, 0, 1, -1, 1, 0, -1, 0, 1, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 1, 0, -1, 1, -1, 0, 1, -1, 0, 1, 0, -1, 1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 0, 1, -1, 1, 0, -1, 1, -1, 0, 1, 0, -1, 1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1
Offset: 1
Positions of -1 are
A156242 (descents).
Positions of 1 are
A156243 (ascents).
-
a054354 n = a054354_list !! (n-1)
a054354_list = zipWith (-) (tail a000002_list) a000002_list
-- Reinhard Zumkeller, Aug 03 2013
-
a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 70}, {a2[[n]]}]; Differences[a2] (* Jean-François Alcover, Jun 18 2013 *)
A376604
Second differences of the Kolakoski sequence (A000002). First differences of A054354.
Original entry on oeis.org
-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, 2, -1, -1, 1, 1, -2, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 2, -1, -1, 2, -2, 1, 1, -2, 1, 1, -1, -1, 2, -1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -2, 2, -1, -1
Offset: 1
The Kolakoski sequence (A000002) is:
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, ...
with first differences (A054354):
1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 0, 1, 0, -1, 1, -1, 0, 1, -1, ...
with first differences (A376604):
-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, ...
A078649 appears to be zeros of the first and third differences.
A288605 gives positions of first appearances of each balance.
A333254 lists run-lengths of differences between consecutive primes.
For the Kolakoski sequence (
A000002):
-
kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,2},1,{1,2,1},2,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]]
kol[n_]:=Nest[kolagrow,{1},n-1];
Differences[kol[100],2]
A379017
a(n) is the number of distinct sums s(m) + s(m+1) + ... + s(m+n-1), where s = A000002, and m >= 1.
Original entry on oeis.org
2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 3, 4, 5, 4, 5, 6, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 5, 6, 5, 4, 5, 6, 5, 6, 7, 6, 5, 6, 5, 6, 7, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 6, 5, 6, 5, 6, 7, 6, 7, 6, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 7
Offset: 1
Starting with s = (1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, ...) we form a shifted partial sum array:
(row 1) = (1,2,2,1,1,2,1,2,2,...)
(row 2) = (s(1)+s(2), s(2)+s(3), s(3)+s(4), ...) = (3,4,3,2,3,3,3,4,...) = A333229
(row 3) = (s(1)+s(2)+s(3), s(2)+s(3)+s(4), s(3)+s(4)+s(5), ...) = (5,5,4,4,4,5,5,5,5,5,5,4,...)
The number of distinct numbers in (row 3) is 2, so a(3) = 2.
The first 12 rows of the shifted partial sum array: (1, 2), (2, 3, 4), (4, 5), (5, 6, 7), (6, 7, 8, 9), (8, 9, 10), (9, 10, 11, 12), (11, 12, 13), (13, 14), (14, 15, 16), (15, 16, 17, 18), (17, 18, 19). These rows illustrate that fact that the integers in each row are consecutive.
-
s = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, 24], 1]; (* A000002 *)
Length[s]
r[1] = s;
r[n_] := r[n] = Rest[r[n - 1]];
c[n_] := c[n] = Take[r[n], 1000];
sum[n_] := Sum[c[k], {k, 1, n}];
t = Table[Union[sum[n]], {n, 1, 100}]
Map[Length, t]
Showing 1-3 of 3 results.
Comments