I need to generate a sequence of numbers that has a recurrence relation of a(n+1) = a(n)+1. I got this recurrence relation from Wolfram Alpha after inputing a series of numbers, from a list of series. I am unsure what the a variable is however, and I am wondering if there is some library in Javascript for these kinds of operations.
Step by Step For clarification:
Step 1, was to derive the number sequences which yield the intended result: For the number input (7), the pattern out put should be []=[0,4,5,6,7,8,0,1,4,5,6,7,8,0,4,5,6,7,8] and if the number input was (16) it would be [] = [0,1,2,3,7,8,0,1,2,3,7,8,0,1,2,3,4,7,8].
Step 2, was (using the concept of Mathematical Sequence Induction), I found that when the numbers were input in Wolfram Alpha they had a recurrence relation of a (n+1) = a (n) + 1. Thus I am assuming there is some way I can use that equation to output an array like above for a number, like (7) or (16).
For more information on adding the sequence to Wolfram Alpha: https://www.wolframalpha.com/examples/Sequences.html
A sample sequence: https://www.wolframalpha.com/input/?i=0,1,2,3,7,8,0,1,2,3,7,8,0,1,2,3,4,7,8