jizzel / algo-dsa

leetcode
0 stars 0 forks source link

MISC-[Java/Python]-03 Non-Fibonacci Generator #51

Open jizzel opened 2 months ago

jizzel commented 2 months ago

Non-Fibonacci Numbers Generator

The (Fibonacci sequence) is a non-decreasing sequence of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, …

Non-Fibonacci numbers are the integers that do not appear in the Fibonacci sequence. These numbers fill the gaps between consecutive Fibonacci numbers: 4, 6, 7, 9, 10, 11, 12, 14, …

Task

Write an infinite generator that produces a sequence of non-Fibonacci numbers. The input is a number N, which specifies how many non-Fibonacci numbers should be printed. Each number should appear on a new line.

Example

Input: 5

Output: 4 6 7 9 10