The Gijswijt’s Sequence is named after DION GIJSWIJT by Neil Sloane. The Sequence is similar to the kolakoski Sequence, but it counts the most extended blocks in terms of length.

## Gijswijt’s Sequence Introduction:

Gijswijt’s Sequence can be defined as: –

It is a self-describing sequence where the value of each term is equal to the maximum number of repeated blocks of numbers in the Sequence preceding the number.

**The first few values of GIJSWIJT’S Sequence are: –**

1, 1, 2, 1, 1, 2, 2, 2, 3, 1, 1, 2, 1, 1, 2, 2, 2, 3, 2, 1, …

Let us know the explanation of these terms: –

- The first term of the Sequence is 1 by definition.
- 1 in the second term shows the length 1 of the block of 1s.
- 2 in the third term shows the length of 2 of the block of 1s in the first and second terms.
- Now, you can see that the Sequence is decreasing at this point for the first time.
- 1 in the fourth term represents the length 1 of the block of 2s in the 3rd term and the length 1 of the block “1, 2”.
- There is no block of any repeated sequence immediately preceding the fourth term that is longer than length 1.
- 1 in the fifth term shows that the length 1 of the “repeating” blocks “1” and “2, 1” and “1, 2, 1” and “1, 1, 2, 1” immediately precede the fifth term. None of these blocks are repeated more than once, so the fifth term is 1.
- And so on…………………….

## Properties of Gijswijt’s Sequence

- Slow rate of growth
- Recursive structure
- Similarity to kolakoski Sequence

**Note: **– It has been proved that every natural number occurs in this Sequence at least once, but the Sequence has prolonged growth. The 220th term is 4, whereas the term 5 occurs in the Sequence near the **10^10^23th term.**

## Practice questions

Practice questions related to the Gijswijt’s Sequence: –

- A positive integer n is given to you. You have to find the first n terms of the Gijswijt Sequence.

**Case 1** = If n is 3, which means

Input = 3

The output or the first n terms of the Sequence will be 1,1,2.

**Case 2** = If n is 7, which means

Input = 7

The output will be, or the first n terms of the Sequence will be 1,1,2,1,1,2,2,

## Practice: –

- A positive integer n = 6 is given to you. What will be the first n terms of the GIJSWIJT’S Sequence?