rqnoj数列
的有关信息介绍如下:program p4;var i,j,k,n:longint; a,b,ans:array[0..10000] of longint;begin readln(k,n); i:=0; while n<>0 do begin a[i]:=n mod 2; n:=n div 2; inc(i); end; n:=i-1; for i:=n downto 0 do b[n-i]:=a[i]; ans[1]:=a[n]*k+a[n-1]; for i:=2 to n do ans[i]:=ans[i-1]*k+a[n-i]; writeln(ans[n]);end.