# Calculate the result of a recursive equation in Wolfram Alpha?

Posted 3 months ago
594 Views
|
3 Replies
|
3 Total Likes
|
 I am looking for a way to solve $B(P,N)$ function with Wolfram|Alpha.Where $B(P,N)$ is a recursive function defined as follows:$B(P,N)=\frac{-(-1)^{\frac{N}{2^{P-1}}+\sum_{i=1}^{P-1}(\frac{-B(P-i,N)}{2^{i}})}+1}{2}$ $P\in \mathbb{N}_{>0}$ $N\in \mathbb{N}$Note that $\sum_{i=1}^{0}f(x)=0$ summation is an empty sum, so: $$B(1,N)=\frac{-(-1)^{\frac{N}{2^{1-1}}+\sum_{i=1}^{0}(\frac{-B(0,N)}{2^{i}})}+1}{2}=\frac{-(-1)^{\frac{N}{2^{0}}+0}+1}{2}=\frac{-(-1)^{N}+1}{2}$$I've tried solving $B(2,7)$ with Wolfram|Alpha, but it doesn't seem to work -- SEE LINK
3 Replies
Sort By:
Posted 3 months ago
 Hi Parminder,Using WL b[p_Integer, n_Integer] := (-Power[-1, n/Power[2, p - 1] + Sum[-b[p - i, n]/Power[2, i], {i, 1, p - 1}]] + 1)/2  $$\frac{1}{2} \left(-(-1)^{\frac{n}{2^{p-1}}+\sum _{i=1}^{p-1} -\frac{b(p-i,n)}{2^i}}+1\right)$$ b[2, 7] (* 1 *) Table[b[p, n], {p, 0, 7}, {n, 0, 80}] // ArrayPlot I don't know how to do this on Wolfram|Alpha.