我对maple有点陌生,有以下编程问题。我想为maple编写以下递归关系。
i_{4n}=i_n,
i_{4n+1}=i_{2n}
i_{4n+2}=-i_{2n}
i_{4n+3}=i_n.
$i_0=1$.发布于 2015-09-08 05:11:24
在Maple中这很容易-可能比问这个问题更容易。我将使用Ii作为过程名,因为我不喜欢在过程中使用像i这样的公共变量名。
Ii:= proc(n::nonnegint)
option remember;
local q,r;
q:= iquo(n,4,'r'); #integer quotient and remainder
`if`(r=0 or r=3, thisproc(q), (-1)^(r-1)*thisproc(2*q))
end proc:
Ii(0):= 1: #Set initial value.https://stackoverflow.com/questions/32440964
复制相似问题