I was reading the linked document titled "Quantum Programming in QCL" which contains the following definition of a Fibonacci function. As far as I can tell this thing calculates nothing like the Fibonacci sequence. Can anyone explain what the thinking is behind this code?
int Fibonacci(int n) { // calculate the n-th
int i; // Fibonacci number
int f; // by iteration
for i = 1 to n {
f = 2*f+i;
}
return f;
}