GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/****************************************************************************1**2*A close_subgroup.c ANUPQ source Eamonn O'Brien3**4*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany5*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia6**7*/89#include "pq_defs.h"10#include "pcp_vars.h"11#include "pga_vars.h"1213/* return the rank, t, of the smallest characteristic,14k-initial segment subgroup in the p-multiplicator */1516int17close_subgroup(int k, int ***auts, struct pga_vars *pga, struct pcp_vars *pcp)18{19register int *y = y_address;2021register int alpha, i, j;2223int t = MIN(k + 1, pga->multiplicator_rank); /* least possible rank value */24int n = y[pcp->clend + pcp->cc - 1]; /* number of pcp generators of group */2526Logical complete = (t == pga->multiplicator_rank);2728int start = t;2930for (alpha = 1; alpha <= pga->m && !complete; ++alpha) {31i = n;32while (i < n + t && !complete) {33++i;34j = y[pcp->clend + pcp->cc];35/* find the last non-zero entry in the image of generator i */36while (auts[alpha][i][j] == 0 && j > n + t)37--j;38t = j - n;39complete = (t == pga->multiplicator_rank);40}41}4243/* if rank of closure has increased, must now close new subgroup */44if (t != start)45t = close_subgroup(t - 1, auts, pga, pcp);4647return t;48}495051