Sub LOG1()

Sheets.Add

 

Range("A1").Select

 

Range("A1").Value = "x0:"

X0 = InputBox("Initial value X0 (0 to 1)?")

Range("B1").Value =X0

 

Range("A2").Value = "a:"

a = InputBox("a value (0-4)?")

Range("B2").Value = a

 

Range("A3").Value = "N:"

n = InputBox("Number of Iterations N?")

Range("B3").Value = n

 

Range("D1").Value = "n"

Range("E1").Value = "Xn"

 

xold = x0

 

For i = 0 to n

xnew = a * xold * (1 - xold)

Cells(i + 2, 4).Value = i

Cells(i + 2, 5).Value = xold

xold = xnew

Next i

End Sub