I am trying to enumerate in 'C#' all the possible polynomials given the degree. Is there any algorithm to enumerate all possible polynomials given degree n? Maybe I don't know how to ask this question precisely but these are the examples:
For example:
for n=1:
x+1 return [1 1]
x return [1 0]
for n=2:
x^2+x+1 return [1 1 1]
x^2+x return [1 1 0]
x^2 return [1 0 0]
x^2+1 return [1 0 1]
for n=3:
x^3 return [1 0 0 0]
x^3+x^2 return [1 1 0 0]
x^3+x return [1 0 1 0]
x^3+x^2+x return [1 1 1 0]
x^3+1 return [1 0 0 1]
x^3+x^2+1 return [1 1 0 1]
x^3+x+1 return [1 0 1 1]
x^3+x^2+x+1 return [1 1 1 1]
Any pseudo code or algorithm would help.
Set the leftmost bit, then do a binary counter on the right n bits. You actually need n+1 bits to account for x^0, (in my first attempt I was off by 1).
You can generate an enumeration like so:
Usage: