The Connell sequence starts with the first odd number and continues with the next two even numbers, the next three odd numbers, the next four even numbers, and so on. Therefore, the first ten terms are 1, 2, 4, 5, 7, 9, 10, 12, 14, and 16.
Write a function to generate the terms at the specified positions in the Connell sequence. FOR and WHILE loops are not allowed.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers34
Suggested Problems
-
Select every other element of a vector
36766 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2886 Solvers
-
How long is the longest prime diagonal?
412 Solvers
-
440 Solvers
-
Write c^3 as sum of two squares a^2+b^2
331 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Test suite modified to prevent lookup table solutions.