Solution to Write a simple formula that generates the below mentioned terms. a) 1,2,2,3,4,4,5,6,6,7,8,8,... b) 1,10,11,100,101,110,111,1000,1001,1010,1011 - Sikademy
Author Image

Archangel Macsika

Write a simple formula that generates the below mentioned terms. a) 1,2,2,3,4,4,5,6,6,7,8,8,... b) 1,10,11,100,101,110,111,1000,1001,1010,1011

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question

a.) 1,2,2,3,4,4,5,6,6,7,8,8,....

General formula a(n)=a(n-1)+a(n-3)-a(n-4)\ \ \ \text{For n>4}


b.) 1,10,11,100,101,110,111,1000,1001,1010,1011

Then if n is a positive integer, n can be expressed uniquely in the form

Given a number n all you need to do it find the k where 2^1+2^2+2^3 ...+2^k < n < 2^1+2^2+2^3 ...2^{(k+1)} .

The binary representation of n-(2^1+2^2+2^3 ...2^k) in k+1 bits is the answer.

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-5-stid-8-sqid-3232-qpid-1931