I know that I can get the nth element of the following sequence
1 3 6 10 15 21
With the formula
(n * (n + 1)) / 2
where n
is the nth number I want. How can I generalise the formula to get the nth element of the following sequences where by following sequences I mean
1 -> 1 3 6 10 15 21
2 -> 2 5 9 14 20
3 -> 4 8 13 19
4 -> 7 12 18
5 -> 11 17
6 -> 16
No comments:
Post a Comment