Difficulties implementing recurring formula

Hi,

I want to construct an algorithm in Mathematica to obtain certain number of othonormal polynomials under specific conditions (using recurring formula).
In constructing a definition of my main function I ran into a problem, where it appears that my function goes into a loop of some sort.
While debugging I came to this test program which results in the same error:

Test[n1_] := Module[{q},
   q = Table[0, {n1}];
   q[[1]] := 1;
   q[[2]] := q[[1]];
   Print[q];
   ];

Error I get:

$RecursionLimit::reclim: Recursion depth of 1024 exceeded. >>

I obviously don’t understand some part of assining values…I’m kind of lost. Any help would be much appriciated.

Thnx.

BR

Natasa

Use Set rather than SetDelayed for q[[1]] and q[[2]]

Test[n1_] := Module[{q},
   q = Table[0, {n1}];
   q[[1]] = 1;
   q[[2]] = q[[1]];
   q];

Test[4]

{1, 1, 0, 0}