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.

A054353 Partial sums of Kolakoski sequence A000002.

This page as a plain text file.
%I A054353 #46 Jan 12 2021 12:58:53
%S A054353 1,3,5,6,7,9,10,12,14,15,17,19,20,21,23,24,25,27,29,30,32,33,34,36,37,
%T A054353 39,41,42,43,45,46,47,49,50,52,54,55,57,59,60,61,63,64,66,68,69,71,72,
%U A054353 73,75,76,77,79,81,82,84,86,87,88,90,91,93,95,96,98,100
%N A054353 Partial sums of Kolakoski sequence A000002.
%C A054353 Alternate definition: n such that A000002(n) is different from A000002(n+1). - _Nathaniel Johnston_, May 02 2011
%H A054353 Nathaniel Johnston, <a href="/A054353/b054353.txt">Table of n, a(n) for n = 1..10000</a>
%H A054353 O. Bordelles and B. Cloitre, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Bordelles/bordelles7r.html">Bounds for the Kolakoski Sequence</a>, J. Integer Sequences, 14 (2011), #11.2.1.
%H A054353 Bertran Steinsky, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL9/Steinsky/steinsky5.html">A Recursive Formula for the Kolakoski Sequence A000002</a>, J. Integer Sequences, Vol. 9 (2006), Article 06.3.7.
%F A054353 A000002(a(n)) = (3+(-1)^n)/2; A000002(a(n)+1)=(3-(-1)^n)/2. - _Benoit Cloitre_, Oct 16 2005
%F A054353 a(n) = n + A074286(n) = 2*n - A156077(n) = A156077(n) + 2*A074286(n). - _Jean-Christophe Hervé_, Oct 05 2014
%t A054353 a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1+Mod[n-1, 2]}], {n, 3, 50}, {a2[[n]] } ]; Accumulate[a2] (* _Jean-François Alcover_, Jun 18 2013 *)
%o A054353 (Haskell)
%o A054353 a054353 n = a054353_list !! (n-1)
%o A054353 a054353_list = scanl1 (+) a000002_list
%o A054353 -- _Reinhard Zumkeller_, Aug 03 2013
%o A054353 (Python)
%o A054353 from itertools import accumulate
%o A054353 def alst(nn):
%o A054353   K = Kolakoski() # using Kolakoski() in A000002
%o A054353   return list(accumulate(next(K) for i in range(1, nn+1)))
%o A054353 print(alst(66))   # _Michael S. Branicky_, Jan 12 2021
%Y A054353 Cf. A000002, A074272, A074286, A074288, A078649, A156077.
%Y A054353 Cf. A088568 (partial sums of [3 - 2*A000002(n)]).
%K A054353 nonn,easy
%O A054353 1,2
%A A054353 _N. J. A. Sloane_, May 07 2000