← Morgan Stanley questions

Integers Without Consecutive 1s in Binary Representation

Filed under Morgan Stanley

Given a positive integer N, print all integers between 1 and 2^N (or representations up to N bits) such that there are no consecutive 1s in their binary representation.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.