I am trying to generate an arithmetic and geometric series/sequence with JavaScript.
I am trying to generate an arithmetic and geometric
series/sequence with JavaScript. The thing that makes this challenging is that
I am using user input to determine different parts of the formula I am using to
generate each sequence. I have tried to run the formulas, but I found out i was
running strings through them and not numbers. How do I generate my
sequences/series and still use user input? PS, these are my formulas: (a1 is
first term, d and r are difference/ratio, and n is the nth term)
1.) a1 + d * n
2.)a1 * r^n
