I have three variables like this,
r1 = 4; r2 = 3; r3 = 1;
and I want to insert them into a function use them in a function definition like so:
f[n_] := r[n] + r[n-1]
So I need to have a function that just duplicates the variable, something like:
r = r1 = 4; r = r2 = 3; r = r3 = 1;
Firstly, I thought of doing
r[n_] := r[n]
but that doesn't make much sense.
I was wondering if there is some nice way to do this?