OFFSET
1,2
COMMENTS
In other words, numbers having a binary representation ending in 1, and an odd number of 1's overall. It follows that by decrementing an odd odious number, one gets an even evil number (A125592). - Ralf Stephan, Aug 27 2013
The members of the sequence may be called primitive odious numbers because every odious number is a power of 2 times one of these numbers. Note that the difference between consecutive terms is either 2, 4, or 6. - T. D. Noe, Jun 06 2007
From Gary W. Adamson, Apr 06 2010: (Start)
n: 1 2 3 4 5 6 7 8 9 10 11
n-th odd: 1 3 5 7 9 11 13 15 17 19 21
a(n): 1 7 11 13 19 21
etc. (End)
Numbers m, such that when merge-sorting lists of length m, the maximal number of comparisons is even: A003071(a(n)) = A230720(n). - Reinhard Zumkeller, Oct 28 2013
LINKS
MATHEMATICA
Table[If[n < 1, 0, 2 n - 1 - Mod[First@ DigitCount[n - 1, 2], 2]], {n, 120}] /. n_ /; EvenQ@ n -> Nothing (* Michael De Vlieger, Feb 29 2016 *)
Select[Range[1, 1001, 2], OddQ[Total[IntegerDigits[#, 2]]]&] (* Jean-François Alcover, Mar 15 2016 *)
PROG
(PARI) is(n)=n%2&&hammingweight(n)%2 \\ Charles R Greathouse IV, Mar 21 2013
(PARI) a(n)=4*n-if(hammingweight(n-1)%2, 1, 3) \\ Charles R Greathouse IV, Mar 22 2013
(Haskell)
a092246 n = a092246_list !! (n - 1)
a092246_list = filter odd a000069_list
-- Reinhard Zumkeller, Oct 28 2013
(Python)
def A092246(n): return (n<<2)-(1 if (n-1).bit_count()&1 else 3) # Chai Wah Wu, Mar 03 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Feb 23 2004
STATUS
approved