Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to get WolframAlpha to solve a recurrence and evaluate a result in one query.

For example: If

f[6] == 0, f[0] == 1 
f[i] == (1/2)*f[i+1] + (1/2)*f[i-1]

Then f[3] equals to .. ?

It gives me an analytical result for f, but does not evaluate f[3].

How would I get it to evaluate f[3] on this same query ?

share|improve this question

closed as off-topic by Sjoerd C. de Vries, Yves Klett, Mike Honeychurch, István Zachar, m_goldberg Oct 23 '13 at 10:29

  • The question does not concern the technical computing software Mathematica by Wolfram Research. Please see the help center to find out about the topics that can be asked here.
If this question can be reworded to fit the rules in the help center, please edit the question.

Hello josinalvo, welcome to Mathematica.SE! Your question is about Wolfram Alpha, which is explicitly off-topic on this site. I won't close your question on this occasion, because @Tangshutao has provided a Mathematica answer that some people have upvoted. But please in future ask questions about the software Mathematica here, not about Wolfram Alpha. –  Verbeia Oct 23 '13 at 5:36
This question appears to be off-topic because it is about Wolfram Alpha, which is officially off-topic here. –  Sjoerd C. de Vries Oct 23 '13 at 5:51

1 Answer 1

You can use the RSolve command:

RSolve[{a[n] == 1/2 (a[n + 1] + a[n - 1]), a[0] == 1, a[6] == 0}, a[n], n]

{{a[n] -> (6 - n)/6}}

{{a[n] -> (6 - n)/6}} /. n -> 3

{{a[3] -> 1/2}}

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.