(11C) n-th term of a Geometric Sequence
|
05-21-2018, 09:31 AM
(This post was last modified: 05-22-2018 11:52 AM by Gamo.)
Post: #1
|
|||
|
|||
(11C) n-th term of a Geometric Sequence
Nth term of a Geometric Sequence giving
Initial Value (a) Common Ratio (r) Term (n) Formula: a sub n = ar^n-1 for every integer n ≥ 1 More information about Geometric Progression: https://en.wikipedia.org/wiki/Geometric_progression Example: a=2 r=3.14 n=14 Procedure: Set User Mode 2 A > 2 // Input initial value 3.14 B > 3.14 // Input common ratio 14 C > 14 // Input term D > 5769197.69 // answer on the 14th term What is the sequence number on the 1st and 2nd term on the above example? (1st Term) 1 C > D > 2 (2nd Term) 2 C > D > 6.28 The sequence are 2, 6.28, 19.72, 61.92,....... Program: Code:
Remark: The common ratio of a geometric sequence may be negative, resulting in an alternating sequence, with numbers switching from positive to negative and back. For instance 1, −3, 9, −27, 81, −243, ... is a geometric sequence with common ratio −3. Input 1 A, -3 B, and your choice of term [C] then [D] for answer. ------------------------------------------------------------------------------ This update version can be use for the following: LBL A // To display a geometric progression LBL B // To find from the n-th term LBL C // To find the sum of the giving n-th term Procedure: For geometric sequence: (a) ENTER (r) > f [A] > continue [R/S] For n-th term: (a) ENTER (r) ENTER (n) > f [B] For the Sum of given n-th term: (a) ENTER (r) ENTER (n) > f [C] Example: a=1 r= -3 n= selected term Sequence: 1, -3, 9, -27, 81, -243,...... Geometric Sequence: 1 ENTER -3 f [A] > 1 > [R/S] > -3 > [R/S] > 9 4th term: 1 ENTER -3 ENTER 4 f [B] > -27 Sum to 4th term: 1 ENTER -3 ENTER 4 f [C] > -20 Program: Code:
Gamo |
|||
05-21-2018, 12:47 PM
(This post was last modified: 05-21-2018 01:31 PM by Dieter.)
Post: #2
|
|||
|
|||
RE: (11C) n-th term of a Geometric Sequence
(05-21-2018 09:31 AM)Gamo Wrote: Formula: a sub n = ar^n-1 for every integer n ≥ 1 an = a1 · rn–1 (05-21-2018 09:31 AM)Gamo Wrote: Gamo, all these tests and subroutines are not required. You do not have to check whether r is negative or not, and if it is, also check if n is odd or even. All HP calculators I know can calculate integer powers of negative bases directly. So (–3,14)5 directly yields –305,24... without any problem. This means the more than 40 steps routine at LBL D can be replaced with this: Code: LBL D That's it. If you really want to check for odd or even n and whether r is negative or not, you could do it much shorter. Simply calculate the power with |r| and change the sign if r<0 and n is even. For instance this way: Code: LBL D But again: all this is not required. You know I'm a big fan of using the stack instead of registers, so here's how I would do it: Code: LBL A The ENTER in the second line usually is not required, but this way the program will also run on an HP25. ;-) Usage: a1 [ENTER] r [ENTER] n [A] => an [x] => an+1 [x] => an+2 ... Example: 1 [ENTER] –3 [ENTER] 1 [A] 1 [x] –3 [x] 9 [x] –27 [x] 81 [x] –243 ... Dieter |
|||
05-21-2018, 03:42 PM
Post: #3
|
|||
|
|||
RE: (11C) n-th term of a Geometric Sequence
Dieter Thank You
I like the shorter solution for even or odd routine. Your version of the step through a geometric progression is good but my manual version is easier. Steps: (r) ENTER ENTER ENTER (a) x (multiply) keep repeat this x as desire Example: 1, −3, 9, −27, 81, −243, ... -3 ENTER ENTER ENTER 1 X (repeat multiplication) Gamo |
|||
05-21-2018, 04:06 PM
(This post was last modified: 05-21-2018 04:08 PM by Dieter.)
Post: #4
|
|||
|
|||
RE: (11C) n-th term of a Geometric Sequence
(05-21-2018 03:42 PM)Gamo Wrote: I like the shorter solution for even or odd routine. Maybe it has not become clear yet: You do not need this odd/even thing at all! The 11 step program does it all. (05-21-2018 03:42 PM)Gamo Wrote: Your version of the step through a geometric progression is good but my manual version is easier. Sure... if you start at the beginning of the sequence, i.e. n=1. With the program you can start at, say, n=20 and continue from there. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)