Given an integer N, the task is to print the first N terms of the Lower Wythoff sequence.
Input: N = 5
Output: 1, 3, 4, 6, 8
Input: N = 10
Output: 1, 3, 4, 6, 8, 9, 11, 12, 14, 16
Approach: Lower Wythoff sequence is a sequence whose nth term is a(n) = floor(n * phi) where phi = (1 + sqrt(5)) / 2. So, we run a loop and find the first n terms of the sequence.
Below is the implementation of the above approach:
1, 3, 4, 6, 8
- Print N terms of Withoff Sequence
- Print n terms of Newman-Conway Sequence
- Sum of first N terms of Quadratic Sequence 3 + 7 + 13 + ...
- Print Lower Hessenberg matrix of order N
- Program to print the series 2, 1, 4, 3, 6, 5, .... up to N terms
- Print first N terms of series (0.25, 0.5, 0.75, ...) in fraction representation
- Find n terms of Fibonacci type series with given first two terms
- Program to print Collatz Sequence
- Number of quadruples where the first three terms are in AP and last three terms are in GP
- Convert an unbalanced bracket sequence to a balanced sequence
- Sum of P terms of an AP if Mth and Nth terms are given
- Sum of the series 5+55+555+.. up to n terms
- Sum of the first N terms of the series 5,12, 23, 38....
- Sum of first n terms of a given series 3, 6, 11, .....
- Sum of the first N terms of the series 2, 6, 12, 20, 30....
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.