(PARI)
up_to=65535;
rgs_transform(invec)={my(om=Map(),outvec=vector(length(invec)),u=1);对于(i=1,长度(invesc),如果(mapisdefined(om,invec[i]),my(pp=mapget(om,invec[i];
A004718list(up_to)={my(v=向量(up_tto));v[1]=1;v[2]=-1;对于(n=3,up_to,v[n]=if(n%2,1+v[n>>1],-v[n/2]);(v);};\\代码输入后A004718号.
v004718=A004718列表(up_to);
v323907=rgs_transform(向量(1+up_to,n,A004718号(n-1));
|