An AVEVA PI System data-processing component needs a deterministic Fibonacci sequence for a synthetic telemetry workload. Given an integer n, return the first n Fibonacci numbers, starting with 0 and 1.
The sequence is defined as F(0) = 0, F(1) = 1, and F(k) = F(k - 1) + F(k - 2) for k >= 2. Implement the function iteratively without recursion and without storing previously generated values beyond the output list.
n representing the number of sequence values to generate.n integers, ordered from F(0) through F(n - 1).n is 0, return an empty list.def fibonacci_sequence(n):