Message Boards Message Boards

0
|
3319 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Calculate the result of a recursive equation in Wolfram Alpha?

Posted 2 years ago

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

POSTED BY: Parminder Singh
3 Replies
Posted 2 years ago

Parminder,

You can sign up for a free Wolfram Cloud account here and use the WL from a browser (there are some resource consumption limitations).

If you are unfamiliar with WL then take a look at Stephen Wolfram's book which is available online for free.

You might also find this helpful.

Have fun!

POSTED BY: Rohit Namjoshi

Thanks for the reply Rohit. I have never used WL. Can you suggest me a good development environment for this language?

POSTED BY: Parminder Singh
Posted 2 years 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

enter image description here

I don't know how to do this on Wolfram|Alpha.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract