## Golly script help needed.

For scripts to aid with computation or simulation in cellular automata.

### Golly script help needed.

Hi!
I found an interesting family of oscillators in a Weighted Life rule. The rule is quite complex but
the oscillators are supported by the following minimal "Miniosc" rule:
NW5,NN1,NE5,EE1,SE5,SS1,SW5,WW1,ME0,HI0,RB2,RB7,RB10,RS0,RS5,RS10
and the corresponding Golly rule is:

`num_states=2num_neighbors=8num_nodes=311 0 11 0 02 0 11 1 02 1 33 2 42 3 13 4 64 5 72 1 13 6 94 7 105 8 116 12 121 1 12 14 13 15 93 9 94 16 174 17 175 18 196 12 207 13 215 19 196 20 237 21 248 22 256 23 237 24 278 25 289 26 29`

Let P(n) denote an array of n diagonal cells, like this P(11):
{code]
x = 11, y = 11, rule = Miniosc
10bo\$9bo\$8bo\$7bo\$6bo\$5bo\$4bo\$3bo\$2bo\$bo\$o!
[/code]

This is an oscillator with the period 126. For odd n P(n) seems to be an oscillator with (n+1)/2 as the size
of its smallest phase. For most even n P(n) is a seed of some oscillator, but for example P(2) and P(6)
vanish.
The period of P(n), shortly p(n) here, behaves irregularly for odd integers. For example:
p(15) = 30, p(17) = 1022, p(19) = 126, p(21) = 4094. My problem is that the period of P(n)
may be fairly big even for comparatively small n. I just found that the half-period of P(57) is
536,870,911, and it took nearly two days for my slow code to get it. I extracted the code from
my own simulator that serves me well as a rule-explorer, but its nextGen() is based on an
old Life-program that ! wrote about 15 years ago when learning to program.

Is it hard to write a Python script for Golly to get the period of P(n)? I've coded mainly in C, Java, Qt and
Perl and written few lines in Python.
I found experimentally that for odd n, the maximum population of P(n) is (n*n + 2*n -1)/2 and that occurs
first time at generation (p(n)/2 -1)/2. So the script should do the following for odd input n:
Check that n is odd and n > 1.
Draw P(n) as the starting pattern.
Run generations until population (n*n + 2*n -1)/2 occurs and return its generation.

Since the bounding box of P(n) is the square of nxn cells (determined always by its least phase of (n+1)/2 cells,
writing fast C code to do that should also be possible, but I'm short of time at the moment.

I'm mainly interested in number-theoretic aspects of p(n).

Risto Kauppila
rkauppila

Posts: 5
Joined: February 3rd, 2013, 4:50 am

### Re: Golly script help needed.

The period of P(n) for odd n seems to be always of the form 2^k - 2. Perhaps the solution of the problem
demands more reasoning than coding and computing.

Risto Kauppila
rkauppila

Posts: 5
Joined: February 3rd, 2013, 4:50 am

### Re: Golly script help needed.

The periods of p(n) for odd n seem to be found in OEIS:
A160657

In the rule space I explore a rule is defined by a set of strings
Bxy, Sxy, where x is the number of live diagonal neighbours and
y is the number of live orthogonal neighbours of a cell.
In this notation the rule for B3/S5 is { B03 B12 B21 B30 S14 S23 S32 S41 }
while Miniosc is { B02 B12 B20 S00 S10 S20 }.
In fact, a minimal rule in my isotropic rule space supporting those rectangular
oscillators is { B21 S23 }, By using diagonal weight 5 and orthogonal weight 1
this rule is in MCell: NW5 NN1 NE5 EE1 SE5 SS1 SW5 WW1 ME0 HI0
RB11 RS 13. EricG's Weightedlife->RuleTree(1.0).py gives then this Golly rule:
`num_states=2num_neighbors=8num_nodes=261 0 02 0 03 1 14 2 25 3 36 4 41 1 02 0 62 6 03 7 81 0 12 0 103 8 114 9 122 10 03 11 144 12 155 13 166 4 177 5 186 17 47 18 208 19 217 20 58 21 239 22 24`

I can't see any reason why the rectangular oscillators in this rule behave very similarly than P(n)'s
in Miniosc.
But now this thread seems to be in a wrong forum. The above looks like Nathaniel's stuff.

Risto Kauppila
rkauppila

Posts: 5
Joined: February 3rd, 2013, 4:50 am