2

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

agentp
  • 6,849
  • 2
  • 19
  • 37

1 Answers1

0

It is impossible that with this recurrence relation (a (n+1) = a (n) + 1) you can get the set defined ([0,4,5,6,7,8,0,1,4,5,6,7,8,0,4,5,6,7,8] for 7, [0,1,2,3,7,8,0,1,2,3,7,8,0,1,2,3,4,7,8] for 16) thus relation a(n+1)=a(n)+1 it's just the number relation what defines Z. Although it's trivial, you can check it by induction (so, validating relation with 1, a(1), and later with n+1). If you verify result and next elements in that engine page, you will see that except the ones you had inputed, next ones are just the natural sequence...In other world, that engine had not found the sequence for your pattern.

DvTr
  • 347
  • 1
  • 5