Important Problems Based on Sequences
By admin on August 13, 2016
Category:
Problem:
Problems related to sequence generation and finding if an element fits in a sequence.
Problems

Generate the below sequence with n elements.
 1, 10, 11, 100, 110, 111, 1000.

Note:

Every element in the sequence is a series of 1 or more 1's followed by zero or more 0's.
 For example 101 is an invalid element and does not belong to the sequence, but 1, 10, 11, 100, 110, 111, 1000 etc. belong to the sequence.
 Hint: Binary sequence of numbers is 1, 10, 11, 100, 101, 110, 111, 1000 etc.

Every element in the sequence is a series of 1 or more 1's followed by zero or more 0's.

Find if the element belongs to the sequence 4, 40, 44, 400, 440, 444, 4000, without generating the sequence.

Note:

Every element in the sequence is a series of 1 or more 4's followed by zero or more 0's.
 For example 404 is an invalid element and does not belong to the sequence, but 4, 40, 44, 400, 440, 444, 4000 etc. belong to the sequence.

Every element in the sequence is a series of 1 or more 4's followed by zero or more 0's.

Note:
Solution:
Refer to individual problems under corresponding problem category for solutions.