Hint: Instead of naming your functions
L1[j],S1[j],L2[j],S2[j],...
what if you named them
L[1,j],S[1,j],L[2,j],S[2,j]...
If you did that then could you think of a way of defining
L[i,j] and S[i,j]
in terms of
L[i-1,j] and S[i-1,j] plus a few other details
?
And if you could do that then could you think of a way of defining all n of them
?