Re: Re: too many special linear matrices

• To: mathgroup at smc.vnet.net
• Subject: [mg68800] Re: [mg68765] Re: too many special linear matrices
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Sat, 19 Aug 2006 00:41:03 -0400 (EDT)
• References: <200608160736.DAA06175@smc.vnet.net> <CE14B3F1-9562-4363-9D03-D37E82CF28FB@mimuw.edu.pl> <ec1amo\$os1\$1@smc.vnet.net> <200608180712.DAA02032@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```On 18 Aug 2006, at 09:12, Roger Bagula wrote:

> 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
>

If really so, then it is very strange because my version is:

\$Version

5.1 for Mac OS X (October 25, 2004)

and in my case the code does run, .e.g.

SL[2,2]

{{{0, 1}, {1, 0}}, {{0, 1}, {1, 1}}, {{1, 0}, {0, 1}},
{{1, 0}, {1, 1}}, {{1, 1}, {0, 1}}, {{1, 1}, {1, 0}}}

Length[%]

6

Andrzej Kozlowski

```

• Prev by Date: Problems solving using Solve
• Next by Date: Re: Preventing NIntegrate from reevaluating after DumpSave and Get
• Previous by thread: Re: too many special linear matrices
• Next by thread: Re: too many special linear matrices