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.

A074298 First occurrence of an 'average' valued sequence of length 2n in the Kolakoski sequence (A000002).

This page as a plain text file.
%I A074298 #12 Sep 25 2012 06:30:44
%S A074298 1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,3,1,
%T A074298 1,1,1,1,1,1,1,3,1,1,9,4,4,3,1,4,3,1,1,9,4,4,3,1,1,3,1,1,1,1,1,1,2,1,
%U A074298 1,1,1,1,1,1,1,1,4,3,1,1,1,1,3,1,1,4,3
%N A074298 First occurrence of an 'average' valued sequence of length 2n in the Kolakoski sequence (A000002).
%C A074298 a(n) is the least k such that K(k) + K(k+1) + ... + K(k + 2*n - 1) = 3*n, where K(m) = A000002(m).
%H A074298 Nathaniel Johnston, <a href="/A074298/b074298.txt">Table of n, a(n) for n = 1..10000</a>
%e A074298 a[1]=1, as A000002 begins 1,2 (sum 3) a[2]=1, as A000002 begins 1,2,2,1 (sum 6) a[3]=1, as A000002 begins 1,2,2,1,1,2 (sum 9).
%t A074298 nmax = 90; a2 = {1, 2, 2}; For[n = 3, n <= 2*nmax, n++, For[i = 1, i <= a2[[n]], i++, AppendTo[a2, 1 + Mod[n - 1, 2]]]]; a[n_] := For[k = 1, True, k++, If[Plus @@ a2[[k ;; k + 2*n - 1]] == 3*n, Return[k]]]; Table[a[n], {n, 1, nmax}] (* _Jean-François Alcover_, Sep 25 2012 *)
%Y A074298 Cf. A074296, A074297, A074299.
%K A074298 nonn
%O A074298 1,6
%A A074298 _Jon Perry_, Sep 21 2002
%E A074298 Offset corrected by _Nathaniel Johnston_, May 02 2011