Introduction
In this lab, you will learn how to check if a given number is a Fibonacci number in Java. We will explore three different approaches to achieve this.
First, you will learn how to generate the Fibonacci sequence up to a specified number of terms. Then, you will implement a method to check if a given number exists within the generated sequence. Finally, we will optimize the checking process by utilizing a mathematical formula that can efficiently determine if a number is a Fibonacci number without generating the entire sequence.