One of my functions automatically generates systems for RecurrenceTable
. Usually works fine, but today I encountered a problem. If the right-hand side is a constant, it doesn't evaluate:
RecurrenceTable[{n[t + 1] == 2, n[0] == 1}, n, {t, 0, 10}]
(* RecurrenceTable[{n[t + 1] == 2, n[0] == 1}, n, {t, 0, 10}] *)
One workaround I discovered:
RecurrenceTable[{n[t + 1] == 2 + Unevaluated[0 n[t]],
n[0] == 1}, n, {t, 0, 10}]
(* {1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2} *)
Are there others? Should this be considered a bug?
Comments
Post a Comment