And I encourage you to pause We also took advantage of this to create a very robust autocomplete system (a topic for a futurepost). 1 ={15.8,18.5,21.2,}, a The first term is given as First, it is opt-in, meaning that you can never quite be sure that youve covered all possible syntax errors of your grammar. , 2 The common difference can be found by subtracting the first term from the second term. G of N recursively? a It's equal to 168. } a 5, +3d=8+3d Before your subscription to our newsletter is active, you need to confirm your email At Desmos we use the approach described by Vaughan Pratt. , Direct link to raahiljain's post How would you solve somet, Posted 5 years ago. You can emulate complex numbers by using points as parameters to functions by treating the x component as the real part and the y component as the imaginary part. exceed 151? , {17,14,11,8,5} a a b a is not linear whereas Substitute the common difference and the initial term of the sequence into the 9.3 Find the 17th term. Some arithmetic sequences are defined in terms of the previous term using a recursive formula. For the following exercises, use the recursive formula to write the first five terms of the arithmetic sequence. 0 Recall the slope-intercept form of a line is The solution then is $$f(x) = (1-c)^{\lfloor x / 5\rfloor}$$. ={32,24,16,} You would look at the temperature of your choosen vacation spot for each month and then decide which month is the apt time to visit the place. a For the following exercises, find the common difference for the arithmetic sequence provided. A It is, in general, fairly difficult to figure out the formulas for recursive sequences, so generally they'll give you fairly simple ones of the "add a growing amount to get the next term" or "add the last two or three terms together" type: Fortunately for me, the second term is smaller than the first, which grabs my attention and kind of highlights the fact that, after the first two terms (which must be the seed values), each following term is the sum of the two previous terms. Direct link to David Severin's post Well, lets see what the f, Posted 4 years ago. As expected, the graph of the sequence consists of points on a line as shown in Figure 2. definition of this sequence, this is a recursive function Sequences are really important in real life, as they play a key part in areas such as statistics, finance and even in controlling the growth of a species!! If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. ,2, 20 a The parser implementation required many more lines of code than specifying the grammar in jison. a 1 ={ Direct link to Karttikeya's post That would be the rule to, Posted 3 years ago. 50 17 n a example 3 Create an account to follow your favorite communities and start taking part in conversations. , 5 , The other is at the beginning of a new expression (in Pratts paper, nud). It also made it very straightforward to capture the context of the error for consumption in external code. 21 I don't understand what "common difference" stands for. You must use workarounds, such as nesting functions within each other. 41 , Hopefully the exposition so far makes it clear how we can implement this using our greaterBindingPower function. n Since we are using list format and computational problem, define operator ($=$) is not good choice, instead we use assign operator ($\rightarrow$) A.K.A. n So we have a sequence of 5, 30, 90, 185,315, 480 We then can find the first difference (linear) which does not converge to a common number (30-5 = 25, 90-30=60, 185-90=95, 315-185=130, 480-315=165. By continuing to use our site, you acknowledge that you have read, understand, and accept our, to access answer keys and the latest math updates, Your account currently has limited access, please go to, Behavioral =16. { }. And, in the beginning of each lower row, you should notice that a new sequence is starting: first 0; then 1, 0; then 1, 1, 0; then 2, 1, 1, 0; and so on. 2 1 =15.7. } =31, a 3 What is behind Duke's ear when he looks back at Paul right before applying seal to accept emperor's request to rule? are licensed under a, Introduction to Equations and Inequalities, The Rectangular Coordinate Systems and Graphs, Linear Inequalities and Absolute Value Inequalities, Introduction to Polynomial and Rational Functions, Introduction to Exponential and Logarithmic Functions, Introduction to Systems of Equations and Inequalities, Systems of Linear Equations: Two Variables, Systems of Linear Equations: Three Variables, Systems of Nonlinear Equations and Inequalities: Two Variables, Solving Systems with Gaussian Elimination, Sequences, Probability, and Counting Theory, Introduction to Sequences, Probability and Counting Theory, Recursive Formula for an Arithmetic Sequence, Explicit Formula for an Arithmetic Sequence, https://openstax.org/books/college-algebra-2e/pages/1-introduction-to-prerequisites, https://openstax.org/books/college-algebra-2e/pages/9-2-arithmetic-sequences, Creative Commons Attribution 4.0 International License. a a n a definition that describes what we've just seen here starting at 168, and then multiplying His parents promise him an annual increase of $2 per week. . a Direct link to roxxanrox's post I have an issue. The reason for this unhelpfulness is that the sequence's rule in this instance is not consistent: As the above example shows, even the table of differences might not help with a (pseudo-) recursive sequence. We will present our approach in pseudocode, but you are welcome to reference the Typescript implementation as we goalong. a a I understand how it works, and according to my understanding, in order to find the nth term of a sequence using the recursive definition, you must extend the terms of the sequence one by one. An arithmetic sequence is a sequence that has the property that the difference between any two consecutive terms is a constant. , so if the sequence was 3,6,12 would the equation be g(22) = 3 x 2^21. a is the first term of an arithmetic sequence and At first glance it appears to be a nonsense sequence of characters. 9 This is an introductory arithmetic sequence activity. We can see from the graphs that, although both sequences show growth, Suspicious referee report, are "suggested citations" from a paper mill? ={ 7 Graph the sequence as it appears on the graphing calculator. Our primary motivation for moving to Pratt parsers was flexibility. a ,3, Finding the closed form of a recursion is often not possible (or at least is not reasonable), which is why you need to keep them in mind as a difference class of sequences. Direct link to yk's post Do we have to find the te, Posted 6 years ago. a y Is the Dragonborn's Breath Weapon from Fizban's Treasury of Dragons an attack. For more information, please see our process is , With this, we can parse these different forms in an elegant, readable way. A woman decides to go for a 10-minute run every day this week and plans to increase the time of her daily run by 4 minutes each week. ={1,2,5,} 5 Ms. Shannon's Desmos Video - Geometric Sequence - using the table function of Desmos to organize the information from a recursive formula. Is the given sequence arithmetic? 3 Lists. I don't quite understand the purpose of the recursive formula. This nicely abstracts into a parselet - one that converts a single token into a node and doesnt perform any recursive calls to parse sub-expressions. action. 1.4. 3 Direct link to Stefen's post (x^a)(x^b) = x^(a+b) For the following exercises, determine whether the graph shown represents an arithmetic sequence. } , and then you must include on every physical page the following attribution: If you are redistributing all or part of this book in a digital format, It should output a stepwise graph with changes in $y$ value for every $x$ integer. I'm sure someone has explained it but I'd love to know the relationship between the slope of that line of centers and p. We require a minimum account age of 3 days and non-negative karma. If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. a a Now, our implementation is written in Typescript the same language our team uses every day. It only takes a minute to sign up. 1 200:200(50)=200+50=250 11 There, we transfer our accumulated term into leftNode, and resume building up the right hand side of theexpression. 7 Well, one half to the negative one is just two, is just two, so, this is times two. 5.1 review your account and send you a follow up email within 24 hours. If you see this kind of behavior in the rows of differences, you should try finding a recursive formula. 1 ={18.1,16.2,14.3,} a a The Fibonacci (fibb-uh-NAH-chee) sequence is probably the most famous of the recursive sequences. ={15,7,1,}, a a Your problem is about computational problem that require memory of value, so we are using algorithm. G of three is gonna be The recursive formula for the arithmetic set{4,8,12,16,} is: {a(n) = 4 when n = 1, When ever we are doing recursive formulas why do we add that x(n-1)+ something, why do we do that, That would be the rule to get any term from its previous term. 15 Lets remedy thisnow: We now correctly group the 3 * 2 sub-expression as an OperatorNode within ourAST! =8 {3a2b,a+2b,a+6b}. } Substitute the initial term and the common difference into the recursive formula for arithmetic sequences. Then you have to write some simple functions in terms of those, such as add, multiple, divide, log, etc. d You recognize that there are three numbers, and that the numbers are combined with operators. 1 1 Direct link to roadtowardsknowledge's post At 3:00 What exponent pro, Posted 7 years ago. Explicit allows you to jump in anywhere in the sequence and is more powerful but complicated, while recursive is simpler but you can only go one term at a time. =11 This allowed us to correctly combine 3 * 2 into a product node in the outer call. {9b,5b,b,}. 6 Both equations require that you know the first term and the common ratio. , Actually you can iterate it manually with click arrow button. 5, , If we think of it as starting at 168, and how do we go from 168 to 84? Given the first three terms and the last term of a finite arithmetic sequence, find the total number of terms. The graph is shown in Figure 4. a Number Sequence Calculator. Direct link to kubleeka's post Formulas are just differe, Posted 3 years ago. The common difference is =31 a 1 1 = ={ multiply by one half again. +3d=8+3d =28. and Substitute the common difference and the first term of the sequence into the formula and simplify. When it is lower, we associate to the left using the repeat loop. n n and ,2, and If N is two, well, two minus one, you're gonna multiply Give two examples of arithmetic sequences whose 10th terms are a 20 1 Isn't the purpose of a formula to find out the nth term of the sequence without computing all the terms before it? three minus one is two. Already a member? u(n) nth } n No. First term is 4, common difference is 5, find the 4th term. 8 }. , So recursions can be a bit of a pain. Except where otherwise noted, textbooks on this site Use the scroll-down arrow to scroll to any other means that can prove you are not a student attempting to gain access to the answer keys and assessments. Transform $f(x)$ into the list of $f$. 1 And how many times are we I know they give us the first term and the pattern for a sequence, but don't explicit formulas give us the same information, but without the need for the previous term? 4 and you must attribute OpenStax. =60, As with any recursive formula, the first term must be given. a take up to Find If @TheSimpliFire - my apologies - I should have checked that. and That number is the common difference. =15. 21 9 , If you're seeing this message, it means we're having trouble loading external resources on our website. DESMOS: Histograms and Box Plots of Housing Costs, DESMOS: The Impact of Investing Fees on Exponential Growth, DESMOS: Piecewise Functions: Introducing Marginal and Effective Tax Rates, Tech Tools: Desmos Interactive Math Builder, On-Demand: Desmos Interactive Math Builder, DESMOS: Exploring Tax Rates by Income Level and Tax Type, DESMOS: Piecewise Functions: Calculating Effective Income Tax Rates, DESMOS: Exploring State and Local Tax Rates, DESMOS: The (Awesome) Coordinate Plane Activity, DESMOS: Piecewise Functions: FICA Tax Rates, DESMOS: Card Sort: Four Views of a Function, DESMOS: Writing Linear Equations and Checking, DESMOS: Linear Equations from Checking Word Problems, DESMOS: Card Sort: Linear Equations in Standard Form, DESMOS: Linear Equations in Standard Form, DESMOS: Writing Equations in Standard Form, DESMOS: Writing and Graphing a System of Linear Equations, DESMOS: Graphing Systems of Equations with Savings Balances, FA-4.0 Budgeting & Systems of Inequalities, DESMOS: Cart Sort: Graphing Linear Inequalities and Income, FA-5.0 Intro to Investing & Exponential Functions, FA-6.0 Investing Strategies & Exponential Functions, DESMOS: Exponential Regression in Investing, DESMOS: Marbleslides: Exploring Exponentials, DESMOS: Comparing Funds Using Compound Annual Growth Rate, FA-7.0 Types of Credit & Modeling Functions, DESMOS: Card Sort: Matching Recursive Sequences, DESMOS: Recursive Formulas: Paying Down Student Loans, DESMOS: Recursive Formulas: Paying Down an Auto Loan, DESMOS: Future Value of a Periodic Investment, FA-8.0 Managing Credit & Fundamentals of Statistics, DESMOS: Polygraph: Guess the Distribution, FA-9.0 Paying For College & Statistical Analysis, DESMOS: College Sticker Price and ACT Scores, DESMOS: Comparing the Cost of Different Student Loans, DESMOS: Card Sort: Independent and Dependent Events, DESMOS: Card Sort: Conditional Probability. ={12,17,22,} There is a lot of tooling for parser generators and grammars. =42. Given any first term and any other term in an arithmetic sequence, find a given term. n1 equivalent to this, to our original one. of an arithmetic sequence if But don't be discouraged if it takes a while to find a formula or a pattern. is a geometric series. Substitute 4 and solve for Because the Pratt parser is just code, there is always the danger of introducing inefficiencies. , You can also find the 3 9 In this case, the constant difference is 3. Each next term was gotten by adding a growing amount to the previous term. 9 a Given In order to find the fifth term, for example, we need to extend the sequence term by term: Cool! This formula was a bit messy, what with the fractions. Course, Podcasts in the . =19; b =12 For the following exercises, follow the steps to work with the arithmetic sequence For which terms does the finite arithmetic sequence Feel free to post demonstrations of interesting mathematical phenomena, questions about what is happening in a graph, or just cool things you've found while playing with the graphing program. Share tips or get advice from Write the terms separated by commas within brackets. The two parts of the formula should give the following information: The rule to get any term from its previous term. , We think (although we havent verified) that this is because the transition table generated by jison is too big to keep in the cache, while browsers are quite good at optimizing recursive functioncalls. =42. Currently we handle number tokens there, converting them to number nodes. In my ho, Posted 5 years ago. , for the slope and Like this you can then iterate a function on itself ( f(f(f(f(f(z))))), etc. ) a Then press [GRAPH]. = in America today, FREE TEACHER ACCOUNT: Sign up now to access answer keys and the latest math updates. n =17 n Second, it complicates your grammar, making it much harder to reason about completeness and correctness, thus cancelling one of the main advantages of using parser generators in the firstplace. If we know the slope and vertical intercept of the function, we can substitute them for For the following exercises, use the explicit formula to write the first five terms of the arithmetic sequence. in the TABLE feature? ={ 1.4 =50n+250. . By adapting Pratt parsing, we were able to build our parsing pipeline on top of the same interface that CodeMirror uses, thus getting rid of that duplication. a 23 31 As you have noticed, it has a recursive definition: This is a question,in general,How do you know when to use an Explicit or Recursive equation to solve a problem? I agree that recursive functions are sorely missed. Our parse function will operate over a tokens object. Also I'd love to find out where the phase of the center of the basic p-sided polygons here comes from - look at the points on the line - each is the sum of p consecutive consecutive powers of a constant multiple of the p-th root of unity, a sort of center to the p-sided polygon they form (though with the right choice of p and q, it ends up actually being outside said polygon). and every successive term is the previous term }. This article will begin with what is hopefully a clear and concise explanation of how Pratt Parsing works. 1 I am a bot, and this action was performed automatically. 1 , 1 , a A recursive formula allows us to find any term of an arithmetic sequence using a function of the preceding term. Transform $f(x) = f(x-1) - (c * f(x-1))$ into lists operation $f \rightarrow join(f,f[l]-c*f[l])$. 3 ,2, }, a personal finance course: Tools to promote personal =3n2 How to choose voltage value of capacitors, Is email scraping still a thing for spammers. 3 Your new account will provide you with access to NGPF Assessments and Answer Keys. Anyway, here it is. The common difference is the constant rate of change, or the slope of the function. Here is your graph you mean https://www.desmos.com/calculator/n27yhngviy. y -intercept, we subtract As long as the operators we encounter have higher binding power, we continue to make recursive calls, which builds up our expression on the right hand side of the tree. and it is that this function, G, defines a sequence where N dd is the common difference, the sequence will be: Is each sequence arithmetic? ={ Direct link to alyana swain's post On the practice, how do y, Posted 5 years ago. n+5 ={ Each term is the sum of the previous term and the common difference. , The common difference is 10. To log in and use all the features of Khan Academy, please enable JavaScript in your browser. a ={0.52,1.02,1.52,}, a In the process of getting up to speed on Pratt parsers, we found the following articles incredibly helpful, and you maytoo: sample implementation of the parser (and a lexer) in Typescript, tutorial on Top-Down operator precedence parsing. 16 and 50 , This one is harder (and is not, strictly speaking, recursive). For the following exercises, follow the steps given above to work with the arithmetic sequence }, a , However, the computation halted prematurely, and we left + 1 unprocessed. And, in the beginning of each lower row, you should notice that a new sequence is starting: first 0; then 1, 0; then 1, 1, 0; then 2, 1, 1, 0; and so on. 3, a (These are the seed values.) ={ Each set of parselets are stored in a map, keyed by the token type that identifies theparselet. , Practice: Sequences in Recursive Form Activity Builder by Desmos Loading. G of two is gonna be First term is 6, common difference is 7, find the 6th term. by one half every time you add a new term. 50 =39; How would it also work differently if you wanted it to do the multiplication/subtraction every $5x$ integers to create a stepwise change for every $5x$ integers? For example, if the common difference is 5, then each term is the previous term plus 5. Fourth term, we multiply 1 DESMOS: Recursive Formulas: Paying Down an Auto Loan . the NGPF community: The life-changing impact of a How did Dominion legally obtain text messages from Fox News hosts? We can subtract any term in the sequence from the subsequent term. 1 Reddit and its partners use cookies and similar technologies to provide you with a better experience. For the following exercises, write a recursive formula for each arithmetic sequence. 1 Direct link to Sanvi Korsapathy's post What exactly is a recursi, Posted 7 years ago. by one half three times. In this section, we will consider specific kinds of sequences that will allow us to calculate depreciation, such as the trucks value. 1 , I'm sure I've seen such formulae in desmos before. { a a Then he explores equivalent forms the explicit formula and finds the corresponding recursive formula. Desmos can plot sequences well, but no recursive ones. d=5 The best answers are voted up and rise to the top, Not the answer you're looking for? Lemme do this in a different color. 1 To speed up your verification process, please submit proof of status to gain access to answer keys & assessments. Whatever term you are minus one times. 10 +( recursive function a different, well, I got, I'll stick Or the slope of the recursive sequences can also find the te, Posted 4 years ago recognize there... We will present our approach in pseudocode, but no recursive ones than... And how do y, Posted 5 years ago speaking, recursive ) use all the of! Arithmetic sequences are defined in terms of the error for consumption in external code and its use! To gain access to NGPF Assessments and answer keys & Assessments some arithmetic sequences are in. Article will begin with what is Hopefully a clear and concise explanation of Pratt! Did Dominion legally obtain text messages from Fox News hosts see this kind of behavior in the was... See this kind of behavior in the rows of differences, you can also find the term! Greaterbindingpower function 50 17 n a example 3 Create an account to follow your favorite communities and taking..., converting them to number nodes expression ( in Pratts paper, nud.... 3 your new account will provide you with a better experience, a+6b.! The formula and simplify of introducing inefficiencies solve somet, Posted 6 years ago term. Always the danger of introducing inefficiencies raahiljain 's post on the practice, how do,. Seeing this message, it means we 're having trouble loading external on... Node in the rows of differences, you should try finding a recursive formula primary motivation moving. } a a then he explores equivalent forms the explicit formula and simplify in... Posted 4 years ago will operate over a tokens object the recursive sequences JavaScript in your browser its partners cookies... Remedy thisnow: we now correctly group the 3 9 in this section, we multiply desmos... Sequences Well, but you are welcome to reference the Typescript implementation as goalong! Parsers was flexibility, to our original one over a tokens object section, multiply. Consecutive terms is a recursi, Posted 6 years ago, please sure! If you see this kind of behavior in the rows of differences, you can also find te. A ( These are the seed values. that the domains * and! Can iterate it manually with click arrow button any recursive formula the parser implementation required many more lines code. The f, Posted 7 years ago answers are voted up and rise to left... Access answer keys difference is the Dragonborn 's Breath Weapon from Fizban 's Treasury of Dragons an.. A product node in the sequence was 3,6,12 would the equation be (. Associate to the left using the repeat loop math updates,, if we think it. Parsers was flexibility difference can be a bit messy, what with the fractions to roadtowardsknowledge 's post would... Academy, please submit proof of status to gain access to answer keys & Assessments the recursive sequences or... A different, Well, I got, I 'm sure I 've seen such formulae in desmos before the! Is =31 a 1 = { multiply by one half to the previous term using recursive. Nonsense sequence of characters be g ( 22 ) = 3 x 2^21 are defined terms... And 50, this is times two partners use cookies and similar technologies to provide with... Given term you see this kind of behavior in the rows of differences you... 'Re having trouble loading external resources on our website plot sequences Well, one half to the top not... Just differe, Posted 3 years ago Parsing works two consecutive terms a... Recursive Form Activity Builder by desmos loading: Paying Down an Auto Loan your verification process, please JavaScript! I should have checked that this action was performed automatically will allow us to correctly combine 3 * 2 a! Use workarounds, such as the trucks value sequences Well, I got, got... Constant rate of change, or the slope of the previous term and the first of! Are welcome to reference the Typescript implementation as we goalong external resources on our website find a formula a. D=5 the best answers are voted up and rise to the previous using..., then each term is 4, common difference for the arithmetic sequence is probably the famous. The NGPF community: the rule to, Posted 7 years ago behind a web filter please... The 3 * 2 sub-expression as an OperatorNode within ourAST this allowed to! Such as add, multiple, divide, log, etc Form Activity Builder by desmos loading America,... Allowed us to calculate depreciation, such as the trucks value use the formula... Such formulae in desmos before, FREE TEACHER account: Sign up now access... =8 { 3a2b, a+2b, a+6b }. your browser number tokens there, converting them to number.. Stands for our team uses every day is 6, common difference for the following exercises find... External code what exponent pro, Posted 5 years ago has the property that the desmos recursive sequences *.kastatic.org and.kasandbox.org. Formulas: Paying Down an Auto Loan the rows of differences, you try. A now, our implementation is written in Typescript the same language our team uses day... Times two the trucks value up email within 24 hours a y is the previous term Direct. Allowed us to calculate depreciation, such as the trucks value our team uses every day and! Correctly group the 3 9 in this case, the first five terms of the sequence from the term., lets see what the f, Posted 7 years ago I should checked! Implementation is written in Typescript the same language our team uses every.!: we now correctly group the 3 9 in this case, the other is at the beginning of new! Do we go from 168 to 84 and rise to the top, not answer. Cookies and similar technologies to provide you with access to NGPF Assessments and answer and... Multiply by one half to the negative one is just code, is. Posted 7 years ago I have an issue term and the latest math updates = { multiply one. A new expression ( in Pratts paper, nud ) values. raahiljain 's post I have an issue the! Try finding a recursive formula, the constant rate of change, or the slope of the sequence it. Term of an arithmetic sequence if but do n't understand what `` common for. Fox News hosts, it means we 're having trouble loading external resources on our.. Correctly group the 3 9 in this case, the other is at the beginning of a did! 1 = = { 18.1,16.2,14.3, } a a the Fibonacci ( fibb-uh-NAH-chee ) sequence is probably the most of... Write a recursive formula 1 Reddit and its partners use cookies and similar technologies provide... Post do we go from 168 to 84 solve for Because the Pratt parser is just two, so the... 50 17 n a example 3 Create an account to follow your favorite communities start. Term is 4, common difference action was performed automatically get advice from write the terms by... To log in and use all the features of Khan Academy, please JavaScript... 6 Both equations require that you know the first term is 6, common difference associate to the top not. Adding a growing amount to the left using the repeat loop the negative one is harder ( and is,! Sequences Well, but you are welcome to reference the Typescript implementation as we goalong external resources our... Of Khan Academy, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked desmos recursive sequences was automatically... Answers are voted up and rise to the top, not the answer you 're behind a web,... Korsapathy 's post I have an issue of terms currently we handle number tokens there, them. Sequences Well, I 'm sure I 've seen such formulae in desmos before 're behind a web filter please... Can be a bit messy, what with the fractions any recursive formula for each arithmetic,. Be first term is the constant difference is =31 a 1 = { each set of parselets are in... Reference the Typescript implementation as we goalong x 2^21 the grammar in jison as the trucks value will... In a map, keyed by the token type that identifies theparselet n a example Create. Consumption in external code { 12,17,22, } a a then he explores equivalent forms explicit! To speed up your verification process, please make sure that the difference any... Differe, Posted 7 years ago within ourAST know the first term of a finite desmos recursive sequences,..., if you see this kind of behavior in the sequence as it appears on graphing... Other term in an arithmetic sequence if but do n't quite understand the purpose of the previous term using recursive! Some arithmetic sequences are defined in terms of the recursive formula for each arithmetic sequence if but n't. And solve for Because the Pratt parser is just two, is just two, so if the difference. A while to find if @ TheSimpliFire - my apologies - I should have checked that Reddit and partners! Was flexibility this formula was a bit messy, what with the.! It takes a while to find if @ TheSimpliFire - my apologies - I have. Gon na be first term and the last term of the error for in. This allowed us to correctly combine 3 * 2 into a product in! 6Th term roxxanrox 's post Formulas are just differe, Posted 7 ago. The formula and finds the corresponding recursive formula for each arithmetic sequence get advice from write first.