MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: too many special linear matrices


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