Mock CCC '23 2 S1 - Composite Fibonacci Numbers

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

It's time for CCC! This year, you are participating in CCC remotely, and for some reason, you are allowed to consult ChatGPT during the CCC. The first question asks you to, for T integers, identify whether they are composite Fibonacci numbers. However, you have no idea what they are. You seem to recall something about composite numbers and Fibonacci numbers, so you ask ChatGPT some questions to get oriented.

What is a Fibonacci number? ChatGPT helpfully says the following:

A Fibonacci number is a number in a sequence of numbers called the Fibonacci sequence, which is named after the Italian mathematician Leonardo Fibonacci. The Fibonacci sequence is defined as follows:

The first two numbers in the sequence are 0 and 1.
Each subsequent number in the sequence is the sum of the previous two numbers.
For example, the first few numbers in the Fibonacci sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, etc.

The Fibonacci sequence has many interesting properties and appears in various areas of mathematics, including number theory, geometry, and probability. It is also of interest to biologists, since the Fibonacci sequence appears in the arrangement of leaves and branches on plants, the branching of trees, and the arrangement of scales on pinecones and pineapples.

What is a composite number? ChatGPT helpfully says the following:

A composite number is a positive integer that can be divided evenly by at least one integer other than itself and 1. For example, 4 is a composite number because it can be evenly divided by 2 (4 ÷ 2 = 2). 6 is a composite number because it can be evenly divided by 2 (6 ÷ 2 = 3) or 3 (6 ÷ 3 = 2).

On the other hand, a number that cannot be divided evenly by any integer other than itself and 1 is called a prime number. For example, 2, 3, 5, 7, and 11 are prime numbers, since they have no other positive integer factors besides 1 and themselves.

Composite numbers are also sometimes referred to as "non-prime" or "composite" numbers. There are an infinite number of composite numbers, but there are only a finite number of prime numbers.

So what is a composite Fibonacci number? ChatGPT says the following:

A composite Fibonacci number is a Fibonacci number that is not a prime number. For example, the sixth Fibonacci number (8) is composite because it can be divided evenly by 2 and 4.

You don't think this is correct, so you should ask it again. ChatGPT says the following:

A composite Fibonacci number is a Fibonacci number that is not prime. In other words, it is a Fibonacci number that can be divided by a number other than itself and 1. Examples of composite Fibonacci numbers include 4 (which is 2*2), 6 (which is 2*3), and 12 (which is 2*6).

ChatGPT seems to be incorrect again, especially with its examples. Nevertheless, for the purposes of this problem, a composite Fibonacci number is a Fibonacci number that is composite.

Constraints

1 \le T \le 10^5

1 \le N \le 10^5

In tests worth 5 marks, N is a Fibonacci number.

In tests worth an additional 5 marks, N is composite.

Input Specification

The first line contains one integer, T.

Each of the next T lines contains one integer, N.

Output Specification

Output T lines. On the ith line, if the given integer is a composite Fibonacci number, output YES. Otherwise, output NO.

Sample Input

6
138
8
100
4
6
12

Sample Output

NO
YES
NO
NO
NO
NO

Comments

There are no comments at the moment.