Fibonacci Sequence Generator 2
Fibonacci Sequence Generator 2
submitted by
Sakshi Mali -262
Dhanashri Salunkhe -266
Shreya Gavali - 252
1
Walchand College of Engineering, Sangli
(An Autonomous Institute)
CERTIFICATE
Certified that this project report titled " Fibonacci Sequence Generator " is the original work of
the undersigned, carried out under my supervision and guidance. The project has been prepared in
partial fulfillment of the requirements for the award of the Second Year Mechanical Diploma at
Walchand College of Engineering, Sangli, for the academic year 2024-2025. This work reflects
the dedication, research, and effort invested by the student in understanding the Fibonacci
Sequence Generator.
2
ACKNOWLEDGEMENT
It gives us a great pleasure to acknowledge the contribution of all those who have directly or
indirectly contributed to the completion of this project.
I express my foremost and deepest gratitude to my guide Prof.S.U.patil for her supervision, noble
guidance and constant encouragement in carrying out the project. I am deeply indebted to Prof.
A.V.Kamble, Head of Mechanical Department for his time to time advice and support and also
for providing all the necessary facilities available in the Institute.
Acknowledgement will not be completed if I forget to mention special thanks to all the teaching
and non-teaching staff of Electrical Mechanical Department for rendering support directly or
indirectly.
3
ABSTRACT
This micro-project explores the computation of Fibonacci numbers using a mathematical approach
implemented in Python. Instead of relying on traditional recursive or iterative methods, the project
leverages Binet's formula, a closed-form expression derived from the golden ratio, to compute
Fibonacci numbers efficiently. By avoiding recursion or loops, the formula provides a direct
method for calculating Fibonacci numbers at any given index with high precision.
4
INDEX
5
1. INTRODUCTION
The Fibonacci sequence is one of the most well-known mathematical series, appearing in
numerous natural patterns, mathematical studies, and computational problems. Traditionally,
Fibonacci numbers are computed using iterative or recursive algorithms, which can be
straightforward but become inefficient for large indices due to their computational overhead and
time complexity.
The implementation highlights the power of combining mathematical theory with programming to
optimize computations. This report outlines the underlying theory of Binet's formula, explains its
implementation in Python, and discusses the benefits and limitations of this method compared to
traditional approaches. Through this project, we aim to demonstrate the elegance and utility of
mathematical programming in solving classical computational problems.
6
2. METHODOLOGY
7
3. CODE
# Main program
def fibonacci_sequence():
# Input from the user
n = int(input("Enter the value of n: "))
# Driver code
if _name_ == "_main_":
fibonacci_sequence()
8
4. SAMPLE OUTPUT
9
5. CONCLUSION
This project successfully demonstrated an efficient and elegant approach to computing Fibonacci
numbers using a mathematical formula implemented in Python. The approach not only provides a
deeper understanding of the Fibonacci sequence but also demonstrates the utility of Python for
implementing mathematical algorithms. Future work could explore optimizing the method further
or applying similar techniques to other mathematical sequences or problems.
10