#George Spahn #2/18/2024 #OK TO POST wt := proc(v) local w,i: w:=0: for i from 1 to nops(v) do if v[i] > 0 then w :=w+1: fi: od: w: end: WtEnumerator := proc(q,M,t) local v: add(t^wt(v), v in LtoC(q,M)): end: #Sadly for the challenge problem I couldn't find any pattern. I am curious what is going on there #LtoC(q,M): inputs a list of basis vectors for our linear code over GF(q) #outputs all the codewords (the actual subset of GF(q)^n with q^k elements LtoC:=proc(q,M) local n,k,C,c,i,M1: option remember: k:=nops(M): n:=nops(M[1]): if k=1 then RETURN({seq(i*M[1] mod q,i=0..q-1) }): fi: M1:=M[1..k-1]: C:=LtoC(q,M1): {seq(seq(c+i*M[k] mod q,i=0..q-1),c in C)}: end: