This site is supported by donations to The OEIS Foundation.

Template:Sequence of the Day for October 3

From OeisWiki
Jump to: navigation, search

Intended for: October 3, 2012

Timetable

  • First draft entered by Alonso del Arte on July 10, 2011
  • Draft reviewed by Alonso del Arte on August 7, 2011
  • Draft approved by Daniel Forgues on October 2, 2012
Yesterday's SOTD * Tomorrow's SOTD

The line below marks the end of the <noinclude> ... </noinclude> section.



A084468: Odd numbers with exactly 3 ones in binary expansion.

{ 7, 11, 13, 19, 21, 25, 35, 37, ... }

How can this sequence be computed most efficiently? We could try taking three 1s and then listing the various ways of inserting a varying number of 0 s between the most significant bit and the least significant bit. The middle 1 would also have to be made to wander. Numbers like 10001010 don’t enter our consideration here because they’re even.

And that should lead the train of thought to an easier way: since these numbers are odd, the one power of 2 we always need to have for this sequence is 1. Thus, we can take the numbers that are the sum of two distinct powers of 2 (see A018900), multiply them by 2 and add 1, thus obtaining the requisite binary weight of 3.