+ 1
Sequence of numbers pattern? Help please
What is the pattern behind this sequence of numbers: 1,1,2,3,3,4,5,5, ... I have to recursively generate the first n numbers of this sequence of numbers. Any help is appreciated. :)
5 ответов
+ 4
Filip German the sequence is printed with a simple logic:
if number is odd
print number twice
else
print number once
There now, hope it helps : )
+ 3
S. C. I understand that, but what is the formula for generating those numbers recursively in an array?
+ 2
Ipang thanks :)
+ 2
Filip German You're welcome, good luck : )