Finding all n digit binary numbers with at the most r adjacent digits as 1
Let me explain with an example. If n=4 and r=2 that means all 4 digit binary numbers such that two adjacent digits can be 1. so the answer is 0011 0110 1011 1100 1101

 
Finding all n digit binary numbers with at the most r adjacent digits as 1
===

Let me explain with an example. If n=4 and r=2 that means all 4 digit binary numbers such that two adjacent digits can be 1. so the answer is 0011 0110 1011 1100 1101

 