Why am I getting $n=2$?

102 Views Asked by At

I'm putting together a collection of tables of orders of certain groups and there's a theorem that specifies that some of those groups are infinite. It is Theorem 3(5) of M. I. Prischepov, "Asphericity, atoricity, and symmetrically presented groups":

Prischepov Theorem 3

I've written a programme in GAP to capture $(a)-(c)$ and, luckily, I included $n=2$ by mistake (and it was a mistake because, as you can see, $n$ divides $4r, 4s$, and $2s$, so it does not satisfy any of $(a)-(c)$); however, values of $n=2$ appeared in the output.

Why? What do I do to correct this mistake?

Here is my code:

for n in [2..10] do
    for r in [2..10] do
        for s in [1..10] do
            if
            r>2*s and
            (not (3*r=0 mod n or
            4*r=0 mod n or
            2*s=0 mod n or
            s+r=0 mod n or
            s-r=0 mod n or
            s+2*r=0 mod n or
            s-2*r=0 mod n or
            s+3*r=0 mod n or
            2*s+r=0 mod n) or
            not (3*s=0 mod n or
            4*s=0 mod n or
            5*s=0 mod n or
            2*r=0 mod n or
            r+s=0 mod n or
            r-s=0 mod n or
            r+2*s=0 mod n or
            r-2*s=0 mod n or
            r+3*s=0 mod n or
            2*r+s=0 mod n) or
            not (2*r=0 mod n or
            3*r=0 mod n or
            2*s=0 mod n or
            3*s=0 mod n or
            r+s=0 mod n or
            r-s=0 mod n or
            r+2*s=0 mod n or
            s+2*r=0 mod n))
            then
                H:=[r, n, s];
                Print(H, "\n");
            fi;
        od;
    od;
od;

Print("Done.\n");

Please help :)

1

There are 1 best solutions below

4
On BEST ANSWER

You can't do modular equations like this in GAP. 0 mod n is 0, 2*r is whatever, they're unequal integers! You need to use ((4*r) mod n) = 0 and so on. The problem is that GAP, like lots of computer scientists, treats mod n as a unary suffix operator that returns the canonical representative mod $n$ of its argument.

For example,

gap> 2 = 0 mod 2; #GAP thinks you are testing 2 = 0
false


gap> (2 mod 2) = 0;
true

Also, you missed out the $5r$ condition from (a).