OFFSET
1,2
COMMENTS
An odious number (A000069) is a nonnegative integer with an odd number of ones in its binary expansion.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
Chris Bernhardt, Evil twins alternate with odious twins, Math. Mag. 82 (2009), pp. 57-62; also on JSTOR.
Eric Weisstein's World of Mathematics, Odious Number
EXAMPLE
The sequence of odious numbers (A000069) begins 1,2,4,7,8,11,13,14,16,19,21,..., so the first few odious twins are at 1,7,13, ... .
MATHEMATICA
SequencePosition[Table[If[OddQ[DigitCount[n, 2, 1]], 1, 0], {n, 300}], {1, 1}][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 05 2016 *)
PROG
(PARI) lista(nn) = select(n->((hammingweight(n) % 2) && (hammingweight(n+1) % 2)), vector(nn, i, i)); \\ Michel Marcus, Jul 10 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Mar 10 2009
EXTENSIONS
Comment corrected by Jeff Aronson. - N. J. A. Sloane, Oct 04 2020
STATUS
approved