Gapplet

Given a shift polynomial s Z[X] of degree n-1, the registers content g0, ..., gn-1 of integers, and a natural number k, determine the k first values produced by the shift register as coefficients of a polynomial.

Input s  e.g., X+1 if n = 2
 
Input g0, ..., gn-1,   e.g., 1, 1 if n = 2
 
 
Input k  e.g., 11
 
 
The polynomial g0 + g1X + ··· + gkXk