Showing posts with label sequence. Show all posts
Showing posts with label sequence. Show all posts

Saturday, February 28, 2026

TI-84 Plus CE: Logistic Map

TI-84 Plus CE: Logistic Map


It feels like forever since I with the TI-84 Plus CE.


Introduction


The program LOGISTIC plots the sequence


x = r * x * (1 – x)


where x is initially in the interval (0, 1) and r is a parameter. The sequence traces out the path of recursion.


Depending on the value of r, the sequence can eventually stabilize to a single point, fluctuate then stabilize, eventually bounce between two stable points, or going into the chaos. The higher the r, chance of the latter two possibilities increase. Typically, for any r < 3, the sequence will most likely stabilize.



TI-84 Plus CE Program: LOGISTIC.8xp


Type: TI-Basic Program


ClrHome

Disp “LOGISTIC MAP”

Disp “X1=R*X0*(1-X0)”

Seq

FnOff

Menu(“LAMBDA (R)”, “ENTER”, 1, “RANDOM”, 2)

Lbl 1

Input “0<R≤4: “, R

Goto A

Lbl 2

randInt(1,80) / 20 → R

Pause R

Goto A

Lbl A

Menu(“U(1)=”, ”ENTER”, 3, “RANDOM”, 4)

Lbl 3

Input “U(1)? “, U

Goto B

Lbl 4

rand → U

Pause U

Goto B

Lbl B

{U} → u(nMin)

SEQ(n+1)

“R*u(n)*(1-u(n))” → u

FnOn 1

1 → nMin

50 → nMax

0 → Ymin

1 → Ymax

0 → Xmin

50 → Xmax

DispGraph



Notes:


The Time setting is assumed: x-axis = n, y-axis = u__n


nMin: Sets the counter and the index of the first argument. Typically the counter starts with 0 or 1. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 4. nMin.


Seq: Sets Sequence mode.


I use R for λ since the TI-84 does not have Greek characters (except for π and σ).


randInt(1,80) / 20 → R: Selects random values from 0.05 and 4 with a tick mark of 0.05.


u(nMin): Store the initial conditions. The conditions are entered as a list, even there is only one initial condition. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 1. u(nMin)


SEQ(n+1): In the program editor, I had to select this from the catalog. It is listed under “SEQ(n+1) Type”. This allows for the recurring sequence to be in the format u(n+1) = f(u(n),n).

R*u(n)*(1-u(n))” → u: The u is type from the keyboard: [ 2nd ] [ 7 ].

FnOn 1: Turns the sequence u(n) on.



Examples




Left: r = 3.67, initial point = 0.2. This looks like total chaos as n grows.


Right: r = 3.1, initial point = 0.5. This sequence does not converge to a single value, but eventually provides a bifurcation between two points.


Caution: If r is too high, even if the u(1) is with in the interval [0, 1], the sequence can “escape” and an overflow can occur. I don’t recommend an r higher than 4.


Source


“Logistic map”. Wikipedia https://en.wikipedia.org/wiki/Logistic_map Retrieved October 20, 2025.



Eddie


All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Saturday, October 5, 2024

Sum of Sequential Integers (featuring Swiss Micros DM32)

 Sum of Sequential Integers (featuring Swiss Micros DM32)


What is the sum of the following:

100 + 101 + 102 + 103 + 104 + 105 + … + 997 + 998 + 999?


It’s doable on a calculator, but going straight forward will require a lot of keystrokes (unless you have access to the sigma function (Σ)).


Note that:

100 + 101 + 102 + 103 + 104 + 105 + … + 997 + 998 + 999

= 100 + (100 + 1) + (100 + 2) + (100 + 3) + (100 + 4) + …. + (100 + 897) + (100 + 898) + (100 + 899)

= (100 + 0) + (100 + 1) + (100 + 2) + (100 + 3) + (100 + 4) + …. + (100 + 897) + (100 + 898) + (100 + 899)


Notice the sum starts with a base, 100. The sequence goes for 900 terms in the form of 100+n where n = 0 to 899. Let’s look at a general case.


Let x be a base integer, and S be the sum as:


S = (x + 0) + (x + 1) + (x + 2) + (x + 3) + …. + (x + n)


Rearranging the terms leads us to:


S = (x + x + x + x + … + x) + (0 + 1 + 2 + 3 + 4 + … + n)

There are n + 1 pairs:

S = (x * (n + 1)) + (0 + 1 + 2 + 3 + 4 + … + n)

S = (x * (n + 1)) + (1 + 2 + 3 + 4 + … + n)


The sum of Σ( k, k = 1 to k = n) = 1 + 2 + 3 + 4 + … + n = n * (n + 1) / 2


Then:

S = (x * (n + 1)) + n * (n + 1) / 2


Let’s look at some specific examples:


n = 1

S = (x + 0) + (x + 1)

S = (x + x) + (0 +1)

S = 2 * x + 1


n = 2

S = (x + 0) + (x + 1) + (x + 2)

S = (x + x + x) + (0 + 1 + 2)

S = 3 * x + 3


2 * 3 / 2 = 3


n = 3

S = (x + 0) + (x + 1) + (x + 2) + (x + 3)

S = (x + x + x + x) + (0 + 1 + 2 + 3)

S = 4 * x + 6


3 * 4 / 2 = 6


S = 500 + 501 +502 + 503

S = (500 + 0) + (500 + 1) + (500 + 2) + (500 + 3)

S = (500 + 500 + 500 + 500) + (0 + 1 + 2 + 3)

S = ((3 + 1) * 500) + (3 * 4 / 2)

S = 2000 + 6

S = 2006



S = 250 + 251 + 252 + 253 + … + 269 + 270

Base = 250

n = 270 – 250 = 20


Then:

S = 250 * (20 + 1) + 20 * 21 / 2

S = 5460


Let’s go our original problem:

S = 100 + 101 + 102 + 103 + 104 + 105 + … + 997 + 998 + 999

Base = 100

n = 999 -100 = 899

Then:

S = 100 * (899 + 1) + 899 * 900 / 2

S = 90000 + 404550

S = 494550



The program code calculates the sum:


Swiss Micros DM32 Program (also HP 32SII)


S01 LBL S

S02 INPUT X

S03 INPUT N

S04 RCL N

S05 1

S06 +

S07 RCL× N

S08 RCL N

S09 1

S10 RCL+ N

S11 ×

S12 2

S13 ÷

S14 +

S15 RTN


Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


Saturday, August 20, 2022

Plus42: The Solver SEQ Command

Plus42: The Solver SEQ Command


Solver SEQ Function


In the calculator app Plus42, we can evaluate a sequence of calculations to return a result.  The SEQ is also good for the FOR loop because it allows us to initialize several variables.


Syntax:

SEQ( expr1 : expr2 : expr3: ... : expr_n )


I think this is best illustrated by example.


Example 1


Calculate   f(x) = x * p ÷ t^2


where:

p = 0.01 * a^2

a = 36 *t^2 - 280


Equation:

SEQ1:F=SEQ(L(A:36×T^2-280):L(P:.01×G(A)^2))×X÷EXP(T)


The commands listed in the SEQ are:


1.  L(A:36×T^2-280):  Let A = 36 * T^2 - 280.  T is the input variable.  


2.  L(P:.01×G(A)^2)):  Let P = 0.01 * A^2;  the Get command (G) is used to keep A from the variable menu


The answer is stored in P.


Variables in calculation:  F, T, X


X = 2, T = 0.8, solve for F = 593.3698253


X = 0.3, T = 9, solve for F = 2.57253759


T = 11.1, F = 58.68, solve for X = 22.4853545434


Example 2


Calculate p = Π( n / 4, n = 1 to m)


Equation:

SEQ2: P=FOR(SEQ(L(A:1):L(N:1)):G(N)<=IP(M):L(N:G(N)+1):L(A:G(A)×(G(N)÷4)))


The commands listed in the SEQ are:


1.  L(A:1):   Let A = 1


2.  L(N:1):  Let N = 1


In this example, SEQ is in a FOR command and is used to initialize variables.   


Variables in calculation: M, P


M = 3, solve for P = 0.09375


M = 6, solve for P = 0.17578125


M = 18, solve for P = 93166.79943


If you have not checked out the Plus42 app, please check it out.  The Plus42 is an HP-42S Simulator which builds up on the Free42.   However, the Plus42 adds the solver in a style of the HP 17B and 27S, graphing commands, and units.


Thomas Okken's Plus42 page:  https://www.thomasokken.com/plus42/


Note:  Casio fx-991EX Week - September 5, 2022 to September 9, 2022 


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Sunday, November 15, 2015

The Series ( ((((0 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + … + 1)^-1 and Fibonacci Numbers

The Series ( ((((0 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + … + 1)^-1 and Fibonacci Numbers
  


Add One Then Reciprocate

Define the series t as:

t = ( ((((0 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + … + 1)^-1    (an infinite amount of terms)

This is a sum that can’t be easily stated in summation statement (Σ f(x)). 

On the HP Prime, I programmed this as:

EXPORT TEST1112(n)
BEGIN
LOCAL k, t:=0;
FOR k FROM 1 TO n DO
t:=(t+1)^-1;
END;
RETURN t;
END;

The result seems to converge at 0.6180339785 when n ≥ 27.  Note that 0.6180339785 = ϕ – 1, where ϕ is the Golden Ratio ( ϕ = (√5 + 1)/2)






Fibonacci Gets Involved

Note that:

k =
t =
1
1
2
(1 + 1)^-1 = 1/2
3
(1 + 1/2)^-1 = (3/2)^-1 = 2/3
4
(1 + 2/3)^-1 = (5/3)^-1 = 3/5
5
(1 + 3/5)^-1 = (8/5)^-1 = 5/8
6
(1 + 5/8)^-1 = (13/8)^-1 = 8/13
7
(1 + 8/13)^-1 = (21/13)^-1 = 13/21

We get a sequence of terms {1, 1/2, 2/3, 3/5, 5/8, 8/13, 13/21, 21/34, 34/55, 55/89, 89/144, …} where each term takes the fraction a/b, a is the kth Fibonacci number and b is the (k+1)th Fibonacci number.  Can we show that this sequence of partial sums is convergent?

Each partial sums of the series takes the form F_k / F_k+1 where F is the Fibonacci number.

The closed formula for the Fibonacci number is:

F_k = ( ϕ^k – α^k )/√5 , where ϕ  = (1 + √5)/2 and α = (1 - √5)/2.

Then:

F_k / F_k+1
=( ϕ^k – α^k )/√5 * √5/( ϕ^k+1 – α^k+1)
=( ϕ^k – α^k) / ( ϕ^k+1 – α^k+1 )
= ( ϕ^k / ϕ^k+1) * ( (1 – (α/ϕ)^k) / (1 – (α/ϕ)^k+1) )
= 1/ϕ * ( (1 – (α/ϕ)^k) / (1 – (α/ϕ)^k+1) )

Note that α/ϕ = (1 - √5)/(1 + √5 ) ≈ -0.38197 < 1

As k → ∞,  α/ϕ → 0. 

Hence,

lim k → ∞ (F_k / F_k+1)
= lim k → ∞ (1/ϕ * ( (1 – (α/ϕ)^k) / (1 – (α/ϕ)^k+1) ) )
= 1/ϕ

Simplifying:

1/ϕ
= 2/(1 + √5)
= 2*(1 - √5) / ((1 + √5)*(1 - √5))
= 2*(1 - √5)/-4
= (√5 – 1)/2
= √5/2 – 1/2

Adding and subtracting 1/2:

√5/2 – 1/2 + (1/2 – 1/2)
= (√5 + 1)/2 – 1
= ϕ – 1

Since the sequence of partial sums converge to ϕ – 1, the series

t = ( ((((0 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + 1)^-1 + … + 1)^-1   

converges to ϕ – 1.



This blog is property of Edward Shore.  2015.



Numworks (Python): Parallelograms Described by Vectors

Numworks (Python): Parallelograms Described by Vectors Introduction The script drawpgram.py draws a parallelogram constructed by ...