0
$\begingroup$

Given the sequence a [n], a [n] represents the general term of the sequence. Known conditions include:

a[n + 1] == a[n] + Log[n/(n + 1)], a[1] == 1

The result obtained from this is:

enter image description here

ClearAll["`*"]
RSolve[{a[n + 1] == a[n] + Log[n/(n + 1)], a[1] == 1}, a[n], 
  n] // FullSimplify

How to obtain the correct answer:

a[n] == 1 - Log[n]
$\endgroup$
1
  • $\begingroup$ Both expressions give the same sequence. $\endgroup$ Commented Apr 29, 2023 at 15:29

1 Answer 1

3
$\begingroup$

This can be done as follows.

FunctionExpand[Log[n/(n + 1)], Assumptions -> n \[Element] PositiveIntegers]

Log[n] - Log[1 + n]

RSolve[{a[n + 1] == a[n] + Log[n] - Log[(n + 1)], a[1] == 1}, a[n], n]

{{a[n] -> 1 - Log[n]}}

$\endgroup$
2
  • 1
    $\begingroup$ Or by FunctionExpand[ 1 + Derivative[1, 0][Zeta][0, n] - Derivative[1, 0][Zeta][0, 1 + n], Assumptions -> n \[Element] PositiveIntegers] which results in 1+Log[Gamma[n]]-Log[Gamma[1+n]]. ` $\endgroup$
    – user64494
    Commented Apr 29, 2023 at 14:32
  • 2
    $\begingroup$ +1 Or put the FunctionExpand inside, e.g., RSolve[{a[n + 1] == a[n] + Log[n/(n + 1)] // FunctionExpand, a[1] == 1}, a[n], n] $\endgroup$
    – Bob Hanlon
    Commented Apr 29, 2023 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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