login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A022294 a(n) is the least k>1 such that first n terms of Kolakoski sequence A000002 repeat beginning at k-th term. 5
4, 5, 7, 7, 10, 10, 10, 37, 37, 37, 37, 55, 55, 55, 55, 55, 55, 55, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 15585, 15585, 15585, 15585, 15585, 15585, 15585, 15585, 15585, 15585, 15585, 15585 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Rémy Sigrist, C program for A022294
EXAMPLE
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.
MATHEMATICA
n = 22; seq = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1},
{2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &,
{2, 2}, n], 1]; (* A000002 *)
seq = StringJoin[Map[ToString, seq]]; Most[Flatten[Rest[Reap[NestWhile[# + 1 &, 1,
Sow[First[Last[StringPosition[seq,
StringTake[seq, #], 2]]]] > 1 &]]]]] (* Peter J. C. Moses, Jan 05 2017 *)
PROG
(C) See Links section.
CROSSREFS
Sequence in context: A259600 A088298 A075992 * A087202 A270037 A319132
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 00:03 EDT 2024. Contains 371798 sequences. (Running on oeis4.)