*
Colour
* transforms cellular perfect arrays into larger cellular perfect arrays. Its input data are

– the number of dimensions;

– the size of the alphabet;

– the window size;

– the size of the cellular perfect array ;

– a cellular -perfect array.

– the multiplication coefficient of the alphabet;

– the extension vector having the property .

The *output* of *
Colour
* is

a -ary cellular perfect array of size .

*
Colour
* consists of four steps:

*Blocking*(line 1) arranging: copies (blocks) of a cellular perfect array into a rectangular array of size and indexing the blocks lexicographically (by );*Indexing*(line 2): the construction of a lexicographic indexing scheme containing the elements and having the same structure as the array , then construction of a colouring matrix , transforming the elements of into -ary numbers consisting of digits;*Colouring*(lines 3-4): colouring into a symmetric perfect array using the colouring array that is adding the -fold of the -th element of to each cell of the -th block in (considering the elements of the cell as lexicographically ordered digits of a number).*Report*(line 5): returns the output .

The output consists of blocks, blocks consist of cells and cells consists of elements. If is an element of , then the lexicographic index of the block containing is called the **
blockindex
** of , the lexicographic index of the cell containing is called the

`cellindex`

`elementindex`

Input parameters are , a cellular -perfect array , the output is a -perfect array , where .

*
Colour(
)
*

` 1 arrange the copies of into an array of size blocks 2 construct a lexicographic indexing scheme containing the elements of and having the same structure as 3 construct an array transforming the elements of into -ary numbers of digits and multiplying them by 4 produce the output adding the -th element of to each cell of the -th block in for each block of 5 `**
**`RETURN`

Finally, algorithm *
Growing
* generates a prefix of a growing array . Its input data are , the number of required doubly perfect prefixes of the growing array , then and . It consists of the following steps:

*Initialization*(line 01): construction of a cellular perfect array using`Cellular`

*Resizing*(lines 02–14): if the result of the initialization is not doubly symmetric, then construction of a symmetric perfect array using`Colour`

*Iteration*(lines 15–17): construction of the further prefixes of the growing array repeatedly, using`Colour`

*Report*(line 18): returns the output .

Input parameters of *
Growing
* are and , the output is a doubly symmetric perfect array , which is the th prefix of an -growing array.

*
Growing(
)
*

12 calculation of using formula (29.2) 3`Cellular(`

`)`

is symmetric 4 5`IF`

is not symmetric 6 7 8 9`IF`

`FOR`

10 11`TO`

12 13`Colour(`

`)`

`FOR`

14 15`TO`

`FOR`

16 17`TO`

18`Colour(`

`)`

`RETURN`