运行:=proc(L)local j,r,i,k:j:=1:r[j]:=L[1]:
对于从2到nops(L)的i,如果L[i]=L[i-1],那么r[j]:=r[j',L[i],否则j:=j+1:
r[j]:=L[i]end if end do:[seq([r[k]],k=1..j)]结束过程:
运行长度:=进程(L)映射(nops,运行(L))结束进程:
c:=proc(n)ListTools:-Reverse(convert(n,base,2)):RunLengths(%)end过程:
A:={}:对于n到175,do-if-isprime(nops(c(n)))=true,则A:=`union`(A,{n})else end-if-end-do:A;
|