OFFSET
1,3
LINKS
Andrzej Kozlowski, Re: too many special linear matrices, Mathematica forum, 17 August 2006.
MATHEMATICA
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]]]
a0 = SL[2, 3];
M[n_] := a0[[1 + Mod[n, Length[a0]]]]
v[1] = {0, 1}
v[n_] := v[n] = M[n].v[n - 1]
a = Table[Floor[v[n][[1]]], {n, 1, 50}]
CROSSREFS
KEYWORD
nonn,uned
AUTHOR
Roger L. Bagula, Aug 24 2006
STATUS
approved