Use R ::= Q[t,x,y,z];
Define Rational_Normal_Curve_Ideal(N)
-- first define the 2xN matrix whose 2x2 minors generate the ideal
M := NewMat(2,N);
For C := 0 To N-1 Do
M[1,C+1] := x[C];
M[2,C+1] := x[C+1]
EndFor;
-- then construct the generators of the ideal
L := [];
For C1 := 1 To N-1 Do
For C2 := C1+1 To N Do
P := M[1,C1] M[2,C2] - M[2,C1] M[1,C2];
-- determinant for columns C1,C2
Append(L,P)
EndFor
EndFor;
Return Ideal(L)
EndDefine;
For N := 3 To 5 Do
S ::= Q[x[0..N]],Lex;
PrintLn NewLine, 'degree ', N;
Using S Do -- switch, temporarily, to ring S
I := Rational_Normal_Curve_Ideal(N);
Print('Poincare series: ');
Poincare(S/I);
EndUsing;
PrintLn;
EndFor; -- for statement
degree 3
Poincare series: (1 + 2x[0]) / (1-x[0])^2
degree 4
Poincare series: (1 + 3x[0]) / (1-x[0])^2
degree 5
Poincare series: (1 + 4x[0]) / (1-x[0])^2
-------------------------------
|