I think your numbering of iterations is a little off: usually it is: z_0 = 0 ; z_1 = c ; ...
A different way is to check that z_p is near zero, rather than z_{p+1} is near c. They have the same effect in the end, but it's a little easier to calculate.
Then (what I call) "partials" are the iterations p where |z_p| is smaller than all previous |z_n|. They are good candidates for possible periods. I wrote a small program to calculate them, here's some output, lines with **** are the partials:
$ ./partials -0.509 0.576
n z |z| min
1 -0.509000000000000008 + +0.575999999999999956 i +0.768672231838772757 ****
2 -0.581694999999999962 + -0.010368000000000044 i +0.581787391105204277 ****
3 -0.170738422399000056 + +0.588062027520000030 i +0.612346762132562117
4 -0.825665339327633863 + +0.375190434296955644 i +0.906912958643195766
5 +0.031955390579078591 + -0.043563474492556487 i +0.054027060783695097 ****
6 -0.509876629322802200 + +0.573215824315217226 i +0.767170488467169953
7 -0.577602204115791773 + -0.008538704752669046 i +0.577665314588191370
8 -0.175448603279432458 + +0.585863949370871162 i +0.611570747800398218
9 -0.821454354779731055 + +0.370421976742216996 i +0.901110258425790955
10 +0.028574816132972747 + -0.032569491802020845 i +0.043327726841770761 ****
11 -0.509244251679208726 + +0.574138665520425695 i +0.767440496138881434
12 -0.579305499377257949 + -0.008753630166097426 i +0.579371631726838143
13 -0.173481764432350638 + +0.586142052189469798 i +0.611276065240121014
14 -0.822466582754321607 + +0.372630085156343605 i +0.902942113377815159
15 +0.028598099383947528 + -0.036951585539979570 i +0.046725485147749588
16 -0.509547568385544269 + +0.573886509768666397 i +0.767453223683425945
17 -0.578707001646840746 + -0.008844951163781811 i +0.578774590765840591
18 -0.174176439406013128 + +0.586237270335409733 i +0.611564852795244307
19 -0.822336705086155639 + +0.371782559211755903 i +0.902474336402979138
20 +0.029015385197912136 + -0.035460889501387816 i +0.045818852696383125
and here's the program:
// gcc -std=c99 -Wall -Wextra -pedantic -O3 -o partials partials.c -lm
// ./partials re im
#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
if (argc != 3)
{
fprintf(stderr, "usage: %s re im\n", argv[0]);
return 1;
}
double re = atof(argv[1]);
double im = atof(argv[2]);
double _Complex c = re + im * I;
double _Complex z = 0;
double minimum = 1.0 / 0.0; // infninity
printf(" n z |z| min\n");
for (int n = 1; n < 100; ++n)
{
z = z * z + c;
double absz = cabs(z);
printf("%4d %+.18f + %+.18f i %+.18f", n, creal(z), cimag(z), absz);
if (absz < minimum)
{
minimum = absz;
printf(" ****");
}
printf("\n");
}
return 0;
}
The last partial (if it exists, and it usually does) is called the atom period, and plotting that using different colours in an image gives you connected atom domains, see:
http://www.mrob.com/pub/muency/atomdomain.html