cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A054354 First differences of Kolakoski sequence A000002.

This page as a plain text file.
%I A054354 #43 Oct 11 2024 08:49:37
%S 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,1,0,-1,0,1,
%T A054354 -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,
%U A054354 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
%N A054354 First differences of Kolakoski sequence A000002.
%C A054354 The Kolakoski sequence has only 1's and 2's, and is cubefree. Thus, for all n>=1, a(n) is in {-1, 0, 1}, a(n+1) != a(n), and if a(n) = 0, a(n+1) = -a(n-1), while if a(n) != 0, either a(n+1) = 0 and a(n+2) = -a(n) or a(n+1) = -a(n). A further consequence is that the maximum gap between equal values is 4: for all n, there is an integer k, 1<k<=4 such that a(n+k)=a(n). - _Jean-Christophe Hervé_, Oct 05 2014
%C A054354 From _Daniel Forgues_, Jul 07 2015: (Start)
%C A054354 Second differences: {-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, ...}
%C A054354 The sequence of first differences bounces between -1 and 1 with a slope whose absolute value is either 1 or 2. We can compress the information in the second differences into {-1, 1, -2, 2, -1, 2, -1, 1, ...} since the -1 and the 1 come in pairs; which can be compressed further into {1, 1, 2, 2, 1, 2, 1, 1, ...} since the signs alternate, where we only need to know that the initial sign is negative. (End)
%C A054354 This appears to divide the positive integers into three sets, each with density approaching 1/3. Note there are no adjacent equal parts (as mentioned above). - _Gus Wiseman_, Oct 10 2024
%H A054354 Reinhard Zumkeller, <a href="/A054354/b054354.txt">Table of n, a(n) for n = 1..10000</a>
%F A054354 Abs(a(n)) = (A000002(n)+A000002(n+1)) mod 2. - _Benoit Cloitre_, Nov 17 2003
%t A054354 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 *)
%o A054354 (Haskell)
%o A054354 a054354 n = a054354_list !! (n-1)
%o A054354 a054354_list = zipWith (-) (tail a000002_list) a000002_list
%o A054354 -- _Reinhard Zumkeller_, Aug 03 2013
%Y A054354 Cf. A000002, A054353.
%Y A054354 Positions of 0 are A078649.
%Y A054354 For Golomb's sequence (A001462) we have A088517.
%Y A054354 Positions of -1 are A156242 (descents).
%Y A054354 Positions of 1 are A156243 (ascents).
%Y A054354 First differences (or second differences of A000002) are A376604.
%Y A054354 The Kolakoski sequence (A000002):
%Y A054354 - Restrictions: A074264, A100428, A100429, A156263, A156264, A288605.
%Y A054354 - Patterns: A013947, A013948, A022292, A074262, A074263.
%Y A054354 - Statistics: A074286, A088568, A156077, A156253.
%Y A054354 - Transformations: A054354, A156728, A306323, A332273, A332875, A333229.
%Y A054354 Cf. A333254.
%K A054354 sign
%O A054354 1,1
%A A054354 _N. J. A. Sloane_, May 07 2000