Help:=proc(): print(`Mob(K),M(n) , KickOutZ(L), KOZeb`): print(`KMob(n), RandSeq(n)`): end: with(numtheory): #Mob(K), the first K terms in the mobius sequence Mob:=proc(K) local i: [seq(mobius(i),i=1..K)]: end: M:=proc(n): convert(Mob(n),`+`):end: #KickOutZ(L): inputs a sequence of numbers L #and outputs the same sequence with 0's removed #Warning: for amusement only KickOutZ:=proc(L) local L1,i: L1:=[]: for i from 1 to nops(L) do if L[i]<>0 then L1:=[op(L1),L[i]]: fi: od: L1: end: #KOZ(L): Kick outs zeroes, using Emilie Hogan and #Andrew Baxter's suggestion KOZ:=proc(L) local i: remove(i->evalb(i=0),L): end: #KMob(n): The kicked-out-zero version of Mob(n) KMob:=proc(n): KOZ(Mob(n)): end: #RandSeq(n): a (uniform) random sequence of 1s and -1s #of length n RandSeq:=proc(n) local ra, i: ra:=rand(0..1): [seq(2*ra()-1,i=1..n)]: end: