login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A157970 Evil twin locations: first members of pairs of consecutive evil numbers. 6
5, 9, 17, 23, 29, 33, 39, 45, 53, 57, 65, 71, 77, 85, 89, 95, 101, 105, 113, 119, 125, 129, 135, 141, 149, 153, 159, 165, 169, 177, 183, 189, 197, 201, 209, 215, 221, 225, 231, 237, 245, 249, 257, 263, 269, 277, 281, 287, 293, 297 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
An evil number (A001969) is a nonnegative integer with an even number of ones in its binary expansion.
In the reference it is shown that these evil twins alternate with the odious twins (see A157971), which are pairs of consecutive odious numbers (A000069) having an odd number of ones in their binary expansions).
LINKS
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 evil numbers (A001969) begins 0,3,5,6,9,10,12,15,17,18,20,..., so the first few evil twins are 5, 9, 17, ... .
MATHEMATICA
SequencePosition[Table[If[EvenQ[DigitCount[n, 2, 1]], 1, 0], {n, 300}], {1, 1}][[All, 1]] (* Amiram Eldar, Dec 09 2019 after Harvey P. Dale at A157971 *)
PROG
(PARI) lista(nn) = select(n->(!(hammingweight(n) % 2) && !(hammingweight(n+1) % 2)), vector(nn, i, i)); \\ Michel Marcus, Jul 10 2014
CROSSREFS
Sequence in context: A005006 A369318 A276194 * A054278 A210978 A211434
KEYWORD
nonn
AUTHOR
John W. Layman, Mar 10 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 05:14 EDT 2024. Contains 372319 sequences. (Running on oeis4.)