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.

A006928 a(n) = length of (n+1)st run, with initial terms 1, 2.

This page as a plain text file.
%I A006928 M0070 #32 Feb 16 2025 08:32:31
%S A006928 1,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,1,1,2,1,1,2,1,2,
%T A006928 2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,
%U A006928 1,1,2,1,2,2,1,2,1,1,2,2,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,1
%N A006928 a(n) = length of (n+1)st run, with initial terms 1, 2.
%D A006928 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A006928 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KolakoskiSequence.html">Kolakoski Sequence.</a>
%F A006928 a(n) = A000002(n+1), n > 1.
%e A006928 Start with [ 1,2 ]. a(1)=1, so the second run has length 1, so a(3) must be 1. a(2)=2, so the third run has length 2, so a(4) must also be 1 and a(5) must be 2. a(3)=1, so the 4th run has length 1, so a(6) must be 1; etc. - _Labos Elemer_
%t A006928 a = {1, 2}; Do[AppendTo[a, 1+Mod[n, 2]], {n, 2, 80}, {i, a[[n]]}]; a (* _Jean-François Alcover_, Aug 09 2016, adapted from PARI *)
%o A006928 (PARI) a=[ 1,2 ]; for(n=2,80, for(i=1,a[ n ],a=concat(a,1+(n%2)))); a
%Y A006928 Essentially the same as Kolakoski sequence A000002.
%K A006928 nonn,easy,nice
%O A006928 1,2
%A A006928 _N. J. A. Sloane_