Re: too many special linear matrices

*To*: mathgroup at smc.vnet.net*Subject*: [mg68765] Re: too many special linear matrices*From*: Roger Bagula <rlbagula at sbcglobal.net>*Date*: Fri, 18 Aug 2006 03:12:10 -0400 (EDT)*References*: <200608160736.DAA06175@smc.vnet.net> <CE14B3F1-9562-4363-9D03-D37E82CF28FB@mimuw.edu.pl> <ec1amo$os1$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Andrzej Kozlowski wrote: >The code below will produce the list of elements of SL[n,p] (as long >as n and p are not too large): > >SL[n_, p_] := Module[{vars = > Table[Unique[ > a], {n^2}], iters, mat}, iters = Map[{#, 0, p - 1} &, vars]; mat = > Partition[vars, n]; Reap[ > Do[If[Det[mat, > Modulus -> p] == 1, Sow[mat], Continue[]], Evaluate[Sequence @@ > iters]]][[2, 1]]] > > >For n=2 it gives the lengths: > > >Table[Length[SL[2,Prime[i]]],{i,1,7}] > > >{6,24,120,336,1320,2184,4896} > >which agree with the formula I sent earlier: > >In[16]:= >Table[f[2,Prime[i]],{i,1,7}] > >Out[16]= >{6,24,120,336,1320,2184,4896} > >Andrzej Kozlowski > > > > Andrzej Kozlowski, You give the correct anwers in this post, but your code doesn't run in my 5.1 version. Roger Bagula

**Follow-Ups**:**Re: Re: too many special linear matrices***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>

**References**:**too many special linear matrices***From:*Roger Bagula <rlbagula@sbcglobal.net>