# functions – How to easily define multiple starting values for recursion

I have a recursion that requires $$n$$ starting values but when $$n$$ is quite big it gets rather slow to type them by hand. So usually I just use the syntax

``````a={1,2,3};
f[a, 1, 1] = a[[1]];
f[a, 2, 2] = a[[2]];
f[a, 3, 3] = a[[3]];
f[a_,i_,j_]:= f[a,i,j] = ...
``````

but if the length of the list a is quite long I can’t do this by hand. I know that there is a straightforward way to do this but just can’t figure it out for some reason. I know that approach like

``````Table[f[a, i, i] = a[[i]], {i, 1, Length[a]}]
``````

will not work.