OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..330
Rich Schroeppel, Hasty Pudding Cipher Specification on archive.org, (revised May 1999 ed.), June 1998. (The numbers are called "Swizpoly numbers" here, except that they start with 0 for some reason.)
EXAMPLE
a(5)=37, or 100101 in binary, representing the GF(2)[X] polynomial X^5+X^2+1, because it has degree 5 and is primitive, contrary to X^5, X^5+1, X^5+x^1, X^5+X^1+1 and X^5+X^2.
MAPLE
f:= proc(n) local k, L, i, X;
for k from 2^n+1 by 2 do
L:= convert(k, base, 2);
if Primitive(add(L[i]*X^(i-1), i=1..n+1)) mod 2 then return k fi
od
end proc:
map(f, [$1..40]); # Robert Israel, Nov 05 2023
MATHEMATICA
f[n_] := If[n == 1, 3, Module[{k, L, i, X}, For[k = 2^n+1, True, k = k+2, L = IntegerDigits[k, 2]; If[PrimitivePolynomialQ[Sum[L[[i]]*X^(i-1), {i, 1, n+1}], 2], Return[k]]]]];
Table[f[n], {n, 1, 40}] (* Jean-François Alcover, Mar 29 2024, after Robert Israel *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Francois R. Grieu, Aug 22 2007
STATUS
approved