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.

A022294 a(n) is the least k>1 such that first n terms of Kolakoski sequence A000002 repeat beginning at k-th term.

This page as a plain text file.
%I A022294 #19 Mar 10 2020 17:52:31
%S A022294 4,5,7,7,10,10,10,37,37,37,37,55,55,55,55,55,55,55,82,82,82,82,82,82,
%T A022294 82,82,82,82,460,460,460,460,460,460,460,460,460,460,460,460,460,460,
%U A022294 460,15585,15585,15585,15585,15585,15585,15585,15585,15585,15585,15585,15585
%N A022294 a(n) is the least k>1 such that first n terms of Kolakoski sequence A000002 repeat beginning at k-th term.
%H A022294 Rémy Sigrist, <a href="/A022294/b022294.txt">Table of n, a(n) for n = 1..10000</a>
%H A022294 Rémy Sigrist, <a href="/A022294/a022294.txt">C program for A022294</a>
%e A022294 a(3) and a(4) are both 7 because A000002 begins 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, ... and 1, 2, 2 and 1, 2, 2, 1 both repeat at position 7.
%t A022294 n = 22; seq = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1},
%t A022294 {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &,
%t A022294 {2, 2}, n], 1]; (* A000002 *)
%t A022294 seq = StringJoin[Map[ToString, seq]]; Most[Flatten[Rest[Reap[NestWhile[# + 1 &, 1,
%t A022294 Sow[First[Last[StringPosition[seq,
%t A022294 StringTake[seq, #], 2]]]] > 1 &]]]]]  (* _Peter J. C. Moses_, Jan 05 2017 *)
%o A022294 (C) See Links section.
%Y A022294 Cf. A000002, A074300, A022295.
%K A022294 nonn
%O A022294 1,1
%A A022294 _Clark Kimberling_