Skip to main content
added 151 characters in body
Source Link
garej
  • 4.9k
  • 2
  • 19
  • 43

For diversity reasons:

Table[a[i] /. 
  RSolve[{a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}, a, n][[1]], 
  {i, 0, 15}]

{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610}

or as @J.M. ironically remarked:

Array[DifferenceRoot[
  Function[{a, n}, {a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}]], 16, 0]

For diversity reasons:

Table[a[i] /. 
  RSolve[{a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}, a, n][[1]], 
  {i, 0, 15}]

{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610}

For diversity reasons:

Table[a[i] /. 
  RSolve[{a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}, a, n][[1]], 
  {i, 0, 15}]

{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610}

or as @J.M. ironically remarked:

Array[DifferenceRoot[
  Function[{a, n}, {a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}]], 16, 0]
Source Link
garej
  • 4.9k
  • 2
  • 19
  • 43

For diversity reasons:

Table[a[i] /. 
  RSolve[{a[n] == a[n - 1] + a[n - 2], a[1] == 1, a[2] == 1}, a, n][[1]], 
  {i, 0, 15}]

{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610}