fredreload Posted September 4, 2016 Posted September 4, 2016 I want an equation generator for a set number of sequences, it's not an infinite sequence. For instance 71,73,70,56, I want an equation that would always give me a correct number nth number within this series or even for a series like this 1,1,1,1,2,1,1,1,1. It could be random sequences, but eventually I want to reduce this sequence to an equation so I can always find the nth number within this series, any number after this nth sequence doesn't matter. How can I do this?
Sensei Posted September 4, 2016 Posted September 4, 2016 Sequence 1,1,1,1,2,1,1,1,1 assuming the first one is x=0 could be received with [math]f(x)=2-sgn(abs(x-4))[/math] https://en.wikipedia.org/wiki/Sign_function x must be integer.
fredreload Posted September 4, 2016 Author Posted September 4, 2016 Cool, I want an equation that would apply for any sequence, how about 71,73,70,56?
Sensei Posted September 4, 2016 Posted September 4, 2016 (edited) Cool, I want an equation that would apply for any sequence, [math]f(x)=sgn(abs(x-a_1))*b_1 + sgn(abs(x-a_2))*b_2 + .... + sgn(abs(x-a_n))*b_n[/math] a1....n are indexes. b1....n are values from sequence. Edited September 4, 2016 by Sensei
Sensei Posted September 5, 2016 Posted September 5, 2016 (edited) Cool, I want an equation that would apply for any sequence, Corrected version: [latex]f(x)=(1-sgn(abs(x-a_1)))*b_1 + (1-sgn(abs(x-a_2)))*b_2 + .... + (1-sgn(abs(x-a_n)))*b_n[/latex] a1....n are indexes. b1....n are values from sequence. Edited September 5, 2016 by Sensei
Klaynos Posted September 5, 2016 Posted September 5, 2016 A universal equation does not exist. When in school I loved solving these kind of problems.
fredreload Posted September 5, 2016 Author Posted September 5, 2016 Hmm this equation kind of grows though, but I get your point, I'm thinking of a single variable which doesn't seem possible
Country Boy Posted September 18, 2016 Posted September 18, 2016 One of my teachers gave, as an example, the sequence 23, 25, 26, 18, 17, 16. Those are the numbers of the highway exits he passes on his way to work- he takes exit 26 to a second highway.
wtf Posted September 19, 2016 Posted September 19, 2016 You can always fit finitely many values to a polynomial. https://en.wikipedia.org/wiki/Lagrange_polynomial
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now