[Question]
  [
# Introduction
In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number is evil.
# Challenge
Your job is to write a full program or function which accepts a single, non-negative integer as input and outputs (or returns) whether or not that number is evil.
* You may output any [truthy](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey#2194) value if the number is evil, and any falsy value if the number is not evil.
* You may input and output in [any acceptable format](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods).
* [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are disallowed.
* [OEIS sequence A001969](https://oeis.org/A001969) is the sequence containing all evil numbers.
* [Here](https://oeis.org/A001969/b001969.txt) is a list of the first 10000 evil numbers, for reference (and more test cases!)
* This question is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shorter, the better.
* Don't be put off by extremely short answers in golfing languages. I encourage you to submit in any language you like.
* Here are some test cases:
```
3 => True
11 => False
777 => True
43 => True
55 => False
666 => False
```
## The Leaderboard
At the bottom of the page is a stack snippet containing a leaderboard for this question. (Thanks, @MartinEnder)
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
```
# Language Name, N bytes
```
where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:
```
# Ruby, <s>104</s> <s>101</s> 96 bytes
```
If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:
```
# Perl, 43 + 2 (-p flag) = 45 bytes
```
You can also make the language name a link which will then show up in the leaderboard snippet:
```
# [><>](http://esolangs.org/wiki/Fish), 121 bytes
```
```
/* Configuration */
var QUESTION_ID = 169724; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 81420; // This should be the user ID of the challenge author.
/* App */
var answers = [],
  answers_hash, answer_ids, answer_page = 1,
  more_answers = true,
  comment_page;
function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}
function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}
function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function(data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}
function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function(data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}
getAnswers();
var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;
var OVERRIDE_REG = /^Override\s*header:\s*/i;
function getAuthorName(a) {
  return a.owner.display_name;
}
function process() {
  var valid = [];
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if (OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });
    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    //else console.log(body);
  });
  valid.sort(function(a, b) {
    var aB = a.size,
      bB = b.size;
    return aB - bB
  });
  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function(a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
      .replace("{{NAME}}", a.user)
      .replace("{{LANGUAGE}}", a.language)
      .replace("{{SIZE}}", a.size)
      .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);
    var lang = a.language;
    lang = jQuery('<a>' + lang + '</a>').text();
    languages[lang] = languages[lang] || {
      lang: a.language,
      lang_raw: lang,
      user: a.user,
      size: a.size,
      link: a.link
    };
  });
  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);
  langs.sort(function(a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });
  for (var i = 0; i < langs.length; ++i) {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
      .replace("{{NAME}}", lang.user)
      .replace("{{SIZE}}", lang.size)
      .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }
}
```
```
body {
  text-align: left !important;
  display: block !important;
}
#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}
#language-list {
  padding: 10px;
  width: 500px;
  float: left;
}
table thead {
  font-weight: bold;
}
table td {
  padding: 5px;
}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution by Language</h2>
  <table class="language-list">
    <thead>
      <tr>
        <td>Language</td>
        <td>User</td>
        <td>Score</td>
      </tr>
    </thead>
    <tbody id="languages">
    </tbody>
  </table>
</div>
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr>
        <td></td>
        <td>Author</td>
        <td>Language</td>
        <td>Size</td>
      </tr>
    </thead>
    <tbody id="answers">
    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr>
      <td>{{PLACE}}</td>
      <td>{{NAME}}</td>
      <td>{{LANGUAGE}}</td>
      <td>{{SIZE}}</td>
      <td><a href="{{LINK}}">Link</a></td>
    </tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr>
      <td>{{LANGUAGE}}</td>
      <td>{{NAME}}</td>
      <td>{{SIZE}}</td>
      <td><a href="{{LINK}}">Link</a></td>
    </tr>
  </tbody>
</table>
```
*EDIT: I believe this question is not a duplicate of [this](https://codegolf.stackexchange.com/questions/47870/count-the-number-of-ones-in-an-unsigned-16-bit-integer), because whereas that question is asking to count the number of ones, this question is asking whether the number of ones is even. Although you **can** accomplish this question by simply counting the bits, there are [other approaches too](https://codegolf.stackexchange.com/a/169729/81420).*
  
[Answer]
# Z80 Assembly (8-bit), 2 bytes
The following code only works with values up to 255:
```
; Input is given in register A.
; P flag is set if A is evil.
B7     or A
C9     ret
```
---
# 16-bit version (works on all test cases), 3 bytes
This works with values up to 65535.
```
; Input is given in BC.
; Output is the same as above.
78     ld A,B
A9     xor C
C9     ret
```
If you're feeling adventurous, you can shave off 1 byte by storing the input in `A` and `C` like so
```
      ld BC, 777
C5    push BC
F1    pop AF
```
and then running
```
A9    xor C
C9    ret
```
However, this puts the burden on the caller, so it may be that the two bytes (`push BC` and `pop AF`) should be counted as well.
[Answer]
# JavaScript (ES6), 18 bytes
```
f=n=>n?!f(n&~-n):1
```
[Try it online!](https://tio.run/##FcxBCoMwEEbhq@hGZ0AH3Rai9BylSLCJRNJ/JEqhm1492s2Db/NW@7H7nMJ2tNCXy9kbmAFj6QnVrwXf@jwrdo1Ooi70EJF7SvZLfdfxU952I5qaAlyY4ar4EA@XCH9eD2ZZNYDqpmbOJw "JavaScript (Node.js) ‚Äì Try It Online")
### Explanation
The bitwise logic goes like this:
* For integers, `~-n` is equivalent to `-(-n)-1`, so that just another way of doing `n-1`. In that particular case, we could actually have used `n-1`.
* `n & (n-1)` removes the least significant bit set to **1** in **n** because decrementing **n** turns all trailing **0**'s into **1**'s and clears the **1** that immediately follows (by carry propagation), while leaving everything else unchanged.
**Example for n = 24 (11000 in binary):**
```
  11000 (24)                  11000 (24)
-     1                   AND 10111 (23)
-------                   ---------
= 10111 (23)              =   10000 (16)
   ^                           ^
   |                           |
   +--- this bit is cleared ---+
```
Therefore, we process as many recursive calls as there are **1**'s in the binary representation of **n**, inverting the result each time with `!`. The last call always returns **1**.
**Examples:**
```
f(24) = !f(16) = !!f(0) = !!1 = true
f(7) = !f(6) = !!f(4) = !!!f(0) = !!!1 = false
```
[Answer]
# [Python 2](https://docs.python.org/2/), 25 bytes
```
lambda n:int(bin(n),13)%2
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSHPKjOvRCMpM08jT1PH0FhT1eg/V1p@kUJJanGJQmaegoaxjoKhoY6Cubm5joIJkGNqqmnFxVlQBNSmkKYBUqb5HwA "Python 2 ‚Äì Try It Online")
`bin(n)` gives a result like `'0b10101'`. Reading this as a base-13 integer, we get
$$ \color{red}{11\cdot13^5} + 1\cdot13^4 + 0\cdot13^3 + 1\cdot13^2 + 0\cdot13^1 + 1\cdot13^0 $$
which reduces modulo 2 to
$$\equiv \color{red}{1 \color{pink}{\cdot 1^5}} + 1 \color{#aaa}{\cdot 1^4} + 0 \color{#aaa}{\cdot 1^3} + 1\color{#aaa}{\cdot 1^2} + 0\color{#aaa}{\cdot 1^1} + 1\color{#aaa}{\cdot 1^0} \pmod 2 $$
$$\equiv \color{red}{1}+1+0+1+0+1 \pmod 2.$$
So `int(bin(n),13)%2` equals 1 + (number of ones in `bin(n)`) modulo 2.
If `n` is evil, then the result is 1; otherwise it is 0.
I picked up this trick from [Noodle9](https://codegolf.stackexchange.com/questions/144017/how-on-earth-did-llhuii-output-the-evil-numbers-in-42-bytes-of-python?noredirect=1&lq=1#comment353104_144027).
[Answer]
# Japt `-h!`, ~~5~~ ~~4~~ 3 bytes
```
¬§√•^
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=pOVe&input=NjY2Ci1oIQ==)
---
## Explanation
```
¬§       :Convert to base-2 string
 √•^     :Cumulatively reduce by XORing
        :Implicitly output the last element negated
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 4 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
bSO√à
```
[Try it online](https://tio.run/##MzBNTDJM/f8/Kdj/cMf//@bm5gA) or [verify all test cases](https://tio.run/##MzBNTDJM/V9Waa@k8KhtkoKSfeX/pGD/wx3/df5HG@soGBrqKJibm@somAA5pqaxAA).
**Explanation:**
```
b       # Convert to binary string
        #  i.e. 777 ‚Üí 1100001001
 S      # Change it to a list of 0s and 1s
        #  i.e. 1100001001 ‚Üí ['1','1','0','0','0','0','1','0','0','1']
  O     # Take the sum
        #  i.e. ['1','1','0','0','0','0','1','0','0','1'] ‚Üí 4
   √à    # Check if it's even (1 as truthy, 0 as falsey)
        #  i.e. 4 ‚Üí 1
```
[Answer]
# [R](https://www.r-project.org/), ~~37~~ 26 bytes
```
!sum(scan()%/%2^(0:31))%%2
```
[Try it online!](https://tio.run/##K/r/X7G4NFejODkxT0NTVV/VKE7DwMrYUFNTVdXov7m5@X8A "R ‚Äì Try It Online")
An alternative to [Robert S.'s answer](https://codegolf.stackexchange.com/a/169731/67312), this eschews the built-in bit splitting ~~but ends up less golfy~~ and thanks to JayCe and digEmAll ends up coming in slightly golfier.
Only works for positive integers less than \$2^{31}-1\$.
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~43~~ 38 bytes
---
**Golfed** [Try it online!](https://tio.run/##ZY9BC4JAEIXP7a8YpGAXTNASIdNDQRAEQQUdqoNsay3UbLhrl/C326IZQXOZYd68jzdcD7mW9aJEPl2iGQUuzJS6iQxTyCGpZZLOFT5FYbyd2ppC4oVKN2DetrxTnqScDYKpX8ekRxr74QRGaDPPtNCQwIuArZHbNN9vexRF7TD@CGHoksoieiRXhcj4lUID@6JA4g@WfbA2mLZRvX0hjaDQd6zrUZoJvLrb6ojr0rS7nHZbVjnA4n/ESqKgzhEdK1b2oU7ciOzcaCyu3w "C# (Visual C# Interactive Compiler) ‚Äì Try It Online")
```
i=>Convert.ToString(i,2).Sum(c=>c)%2<1
```
---
**Ungolfed**
```
i => Convert.ToString( i, 2 ).Sum( c => c ) % 2 < 1
```
---
**Full code** with tests
```
Func<Int32, Boolean> f = i => Convert.ToString( i, 2 ).Sum( c => c ) % 2 < 1;
Int32[] testCases = { 3, 11, 777, 43, 55 };
foreach( Int32 testCase in testCases ) {
    Console.Write( $" Input: {testCase}\nOutput: {f(testCase)}" );
    Console.WriteLine("\n");
}
Console.ReadLine();
```
---
**Releases**
* **v1.1** - `-5 bytes` - Replaced `Count` to `Sum`
* **v1.0** - `43 bytes` - Initial solution.
---
**Notes**
* None
[Answer]
# Bash (no external utilities), ~~56~~ 44 bytes
~~`while(($1));do set $(($1/2)) $(($2+$1%2));done;!(($2%2))`~~
```
(($1))&&exec $0 $[$1/2] $[$2+$1%2];!(($2%2))
```
This assumes that the number is found in `$1`, having been passed as the first command line argument. It also assumes that this is a shell script (so that it can `exec` itself).
It recurses, after a fashion, using `exec $0`, until the number (in `$1`) reaches zero, dividing it by two in each iteration. It also sums (in `$2`) the number of times we get a number that is odd. At the end, the original number was "evil" if the sum in `$2` in not odd.
Example invocations:
```
$ ./script 3 && echo evil
evil
$ ./script 11 && echo evil
$ ./script 777 && echo evil
evil
$ ./script 43 && echo evil
evil
$ ./script 55 && echo evil
```
For `0`:
```
$ ./script 0 && echo evil
./script: line 1: ((: %2: syntax error: operand expected (error token is "%2")
evil
```
Correct result, with a bit of extra on the side.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 4 bytes
```
:1|e
```
[Run and debug it](https://staxlang.xyz/#c=%3A1%7Ce&i=3%0A11%0A777%0A43%0A55&a=1&m=2)
```
:1|e Full program, implicit input-evaluation
:1   Count set bits
  |e Check if even
```
[Answer]
# [R](https://www.r-project.org/), ~~99~~ ~~98~~ ~~44~~ ~~34~~ 28 bytes
-1 thanks to Kevin Cruijssen! -54 thanks to ngm! -10 thanks to Giuseppe! -6 thanks to JayCe!
```
!sum(intToBits(scan())>0)%%2
```
[Try it online!](https://tio.run/##K/r/X7G4NFcjM68kJN8ps6RYozg5MU9DU9POQFNV1ei/qel/AA "R ‚Äì Try It Online")
---
Alternatively, using the `binaryLogic` package (39 bytes):
```
!sum(binaryLogic::as.binary(scan()))%%2
```
[Answer]
# PHP, ~~37~~ 36 bytes
```
<?=1&~substr_count(decbin($argn),1);
```
To run it:
```
echo '<input>' | php -nF <filename>
```
Or [Try it online!](https://tio.run/##K8go@P/fxt7WUK2uuDSpuKQoPjm/NK9EIyU1OSkzT0MlsSg9T1PHUNP6/3/jf/kFJZn5ecX/dfPcAA)
Prints `1` for true, and `0` for false.
-1 byte thanks to [Benoit Esnard](https://codegolf.stackexchange.com/users/38454/benoit-esnard)!
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 4 bytes
```
·∏Éo-0
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//@GO5nxdg///TQ3/AwA "Brachylog ‚Äì Try It Online")
[With multiple test cases](https://tio.run/##SypKTM6ozMlPN/pf/ahtw6Ompkcdy5U@zJ/RofRwV@ejjhVA9sQ9IHbtw60T/j/c0Zyva/D/f7SBjoKhjoKRjoKxjoKJjoKpjoKZjoK5joKFjoIlUBAoYQpSYmAY@x8A "Brachylog ‚Äì Try It Online") (üòà is evil and üëº is not.)
Uses something I discovered recently about the `-` predicate: its documentation just says "the difference of elements of [input]", but what it actually does is "sum of even-indexed elements (starting from 0th) of input, minus the sum of odd-indexed elements of input".
Here, 
`·∏É` converts the number into an array of binary digits, 
`o` sorts them to bring all the 1s together. 
Now, if there were an even number of 1s, there would be an equal number of 1s in even indices and odd indices. So the `-` after that would give a 0. But if there were an odd number of 1s, there would be an extra 1 sticking out, resulting in the difference being either -1 or 1. 
So, finally, we assert that the difference is `0`, and get a true or false result according to that. With [more flexible output requirements](https://codegolf.meta.stackexchange.com/a/12308/8774), this could be removed for a 3 byte answer, with 0 as truthy output and -1 and 1 as both falsey outputs. 
[Answer]
# [INTERCAL](http://www.catb.org/~esr/intercal/), ~~90~~ ~~65~~ 63 bytes
```
DOWRITEIN:1
DO:2<-'#0$#65535'~?':1~:1'
DOREADOUT:2
PLEASEGIVEUP
```
[Try it online!](https://tio.run/##y8wrSS1KTsz57@/n@t/FPzzIM8TV08/KkMvF38rIRldd2UBF2czU1NhUvc5e3cqwzspQHSgV5Oro4h8aYmXEFeDj6hjs6u4Z5hoa8P9/sGuYq58ChAQA "INTERCAL ‚Äì Try It Online")
Ungolfed and expanded (for what it's worth) with C style comments.
```
DO WRITE IN :1 //Store user input in 1
DO :2<-:1~:1 //Select just the ones. So will convert binary 10101 to 111
DO :3<-:?2 //Run the unary xor over the result. Essentially, xor with the right bitshifted
           //(with wraparound) value).
DO :9<-#0$#65535 //Intermingle the 16 bit values of all 0's and all 1's, to create a
                 //32 bit number with 1's in the odd positions.
DO :4<-:9~:3 //It turns out that at this point, evil numbers will have no bits in odd
             //positions, and non-evil numbers will have precisely one bit in an odd
             //position. Therefore, the ~ will return 0 or 1 as appropriate.
PLEASE READ OUT :4 //Politely output
PLEASE GIVE UP //Polite and self explanatory
```
I had to make a few concessions to make this feasible in INTERCAL. The first is, as with all INTERCAL programs, numerical input must be written out. So if you want to input `707` you would provide `SEVEN OH SEVEN`.
The second is that INTERCAL doesn't really have proper truthy or falsy value. Instead, it will output the Roman Numeral `I` (1) if the number is not evil, or a 0 (typically represented as `-` since Roman Numerals can't normally represent 0).
If you want to flip those so that evil numbers return 1 and non-evil numbers return 0, you can change lines 4 and 5 from the ungolfed version as follows, although it does add 3 bytes.
```
DO:9<-#65535$#0
DO:4<-#1~:9~3
```
[Answer]
# x86-16, 3 bytes
NASM listing:
```
 1                                  parity16:
 2 00000000 30E0                        xor al,ah
 3 00000002 C3                          ret
```
16-bit integer function arg in AX (which is destroyed), return value in PF.
The hardware calculates the parity of the result for us, in [x86's Parity Flag](https://en.wikipedia.org/wiki/Parity_flag). The caller can use `jp` / `jnp` to branch, or whatever they like.
Works exactly like [@cschultz's Z80 / 8080 answer](https://codegolf.stackexchange.com/questions/169724/is-this-number-evil/169733#169733); in fact 8086 was [designed to make mechanical source-porting from 8080 easy](https://retrocomputing.stackexchange.com/q/6500). 
Note that PF is only set from the low byte of wider results, so `test edi,edi` wouldn't work for an x86-64 version. You'd have to horizontal-xor down to 16 bits, or `popcnt eax, edi` / `and al,1` (where 0 is truthy).
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 36 bytes
```
c;f(n){for(c=0;n;c++)n&=n-1;n=~c&1;}
```
[Try it online!](https://tio.run/##jc/BCsIwDMbxu08RCo6GOTCsZWCZvoiXEVYZaCbdPI356tWbVJB6zOHH/wtXF@YY2XktuPgxaG73ThyXJUrRSkVO2icX5NZ46wbRuGzuYZDZawVQQ3WE7XQWtQOvawSAE6g5PHoFB1C@u069QvcRRIkgwoxomiYR7xszDZOuMnWuAdYmwtqsgC/xx@epoHyDTCrML7HGFw "C (gcc) ‚Äì Try It Online")
Method from K&R <https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan>
Must be compiled with optimization level 0
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~24~~ 22 bytes
* Saved two bytes thanks to [Misha Lavrov](https://codegolf.stackexchange.com/users/74672/misha-lavrov).
```
2‚à£DigitCount[#,2,1]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73@hRx2KXzPTMEuf80rySaGUdIx3DWLX/AUWZeSUOwak5qckl0SGJSTmp0Vk61Vk6BjqGBgYGtbE6abH/AQ "Wolfram Language (Mathematica) ‚Äì Try It Online")
[Answer]
# x86-16 machine code, 3 bytes
```
32 C4     XOR  AL, AH     ; PF = (AX >> 8) XOR AL
C3        RET             ; return to caller
```
Input is `AX`, output is in `PF`; `PE` if `True` (Evil) or `PO` if `False` (Not Evil).
This is actually the exact use of the [x86 Parity Flag](https://en.wikipedia.org/wiki/Parity_flag), with the only twist being that normally it only operates on the LSB of a WORD register. However, you can get the Parity of a WORD by `XOR`'ing the high byte and the low byte.
Example output from a test program for PC DOS:
[![enter image description here](https://i.stack.imgur.com/SFwNY.png)](https://i.stack.imgur.com/SFwNY.png)
DANG IT, I should have looked at the other answers first... @PeterCordes submitted this in 2018...
<https://codegolf.stackexchange.com/a/169903/84624>
[Answer]
# [evil](https://esolangs.org/wiki/Evil), ~~48~~ ~~42~~ ~~40~~ ~~39~~ ~~36~~ 35 bytes
golf 1: flipping many `m`s to `j`s and `j`s to `m`s saved quite a bit of marking mode changes  
golf 2: do..while -> repeat..until   
golf 3: `tbxb` -> `sxb` - can be seen to be the same, but less intuitive   
golf 4: the `vzv` in `vtfvzv` turned out to be renundant, because the accumulator already zero at that point  
golf 5: `aayuoy` -> `aluoy` and `tbuw` -> `tbaw`, now outputs 0x02 for evil and 0x00 for normal  
I can confirm that this language is absolutely *evil*. Even though it is more powerful than e.g. brainfuck, it feels worse.
Inputs via char code, outputs via char code (0x02 = evil, 0x00 = normal). This would be slightly (probably by 1 byte) shorter if the output values could be merely consistent and not necessarily falsy and truthy.
Uses a trick: to count set bits, the code adds elements to the wheel, a circular list, and then calculates the list size's parity by setting the first one to 1, the second one to 2 and traversing the list 2 steps at a time until a non-zero element is found.
```
rvmvtfxjxutctbuvavsxbmaluoymiiptbaw
```
Here's an explained version (I do not expect anybody to understand the monstrosity above, but the explanation is in a spoiler so that you can try) (I was also writing the code immediately with these comments):
> 
> 
> ```
> COMMENTS ARE UPPERCASE, CODE IS LOWERCASE
> 
> r READ INPUT AS CHAR CODE
> NOW DECREASE AND CHECK PARITY, WHILE ALSO COMPUTING N/2 IN THE FIRST PENTAL CELL
> v STORE TO FIRST PENTAL CELL
> m BEGINNING OF OUTER LOOP
> 
> vtf IF ZERO, DONE
> NOW THE ACCUMULATOR HAS THE CORRECT VALUE AND THE PENTAL CELL IS ZERO, JUST LIKE IT SHOULD BE.
> 
> x SET MARKING MODE INITIALLY
> j BEGINNING OF INNER LOOP
> x UNSET MARKING MODE AGAIN
> u FIRST DECREMENT
> IF ZERO (ODD), INCREASE BIT COUNTER AND PROCEED TO NEXT ITERATION
> tc THIS LANGUAGE SEEMS COMPARABLE TO MALBOLGE. THIS ADDS A NEW CELL TO THE WHEEL, A RESIZABLE CIRCULAR LIST. I USE IT AS THE BIT COUNTER
> tb GO TO NEXT ITERATION OF OUTER LOOP
> ODD CASE HANDLED. EVEN CASE IS (MUCH) SIMPLER
> u SECOND DECREMENT
> vav INCREMENT FIRST PENTAL CELL
> 
> sxb IF ZERO, GO TO THE NEXT ITERATION OF THE OUTER LOOP; ELSE GO TO THE NEXT ITERATION OF THE INNER LOOP; EQUIVALENT TO TBXB.
> 
> m END OF OUTER LOOP
> 
> DO SORCERY TO COUNT WHEEL CELLS.
> al SET FIRST WHEEL CELL TO 1 (AND RESET THE ACCUMULATOR BACK TO 0 BY SWAPPING)
> uoy SET SECOND CELL TO -1
> 
> NOW IN A LOOP CHECK WHETHER 1 OR 2 GOES FIRST AND OUTPUT THE CORRESPONDING NUMBER
> 
> m BEGINNING OF THE LOOP
> ii GO RIGHT TWICE
> p READ WHEEL
> tb IF STILL ZERO, GO BACK
> NOW THE NON-ZERO ELEMENT WAS FOUND
> a INCREMENT SO THAT VALUES ARE ACTUALLY FALSY AND TRUTHY. IF THAT REQUIREMENT WASN'T THERE, THE CODE COULD BE REDUCED SLIGHTLY (AT LEAST BY REMOVING THIS BYTE)
> w PRINT
> 
> ```
> 
> 
> 
> 
Now, the most ***evil*** part. This code does not work with the normal interpreter, because it has a bug. The bug is that the command to add a cell to the wheel quite literally doesn't add a cell to the wheel (to be specific, it's missing `wheelSize++;`). I assume that the bug is obvious enough for me to avoid accusations of adding new built-ins to the language.
You can [Try it online!](https://tio.run/##rVhtbyI5Ev68/IqakW6m2YQGsrerVQhzIgmZoEsgImRHq4gPBgzppF9Yt5uXneO3z1W537tNEnSHRpnudvmpctVT5bKf2YrVnmcvP37Uf4bRk@UD/mMwt4Qva0vm@2BMmW2DJWHFhW95LjTMkyp4c2AuWK7kYik4/q3AzzD3BMgnDnxl2bAU3kIwx3IXYDN3EbAFN@HWExz8JZ9ac4twtyivdNJ0mjphPk/kj2FtyScvkGrIl8ydMTED25oIJrYmzqFpoydOoChnz2DCYcYls2w@wwd/KqylRKN9MrhoGtlGALE64LbP14RmwjX@PYYeGoCLfw58CT4jY5kkV6ivkr1wms5cHOAbiU6zOTBy34rZ1ixWY0IHpW1vzcVUrY5L9BeKCTVdWZSYMPUcB5fpm/CwXJYnlJxACORIjJProW3O0uYOx7DMMDihc6O4VU3oe5KHa5DKZzjoeoTgB9MnEsZYKfv9rSvZBrgQGFHEIRtjdz/4aOcpPdHvGfkTLsHZ3nuBmPIr9ILJV3YkXtvze6bByLRT4lSTPghuc1ryjEl@Cs1G/Zdm/aTROKGxToBcEKcw8hz4JrjrT59eUxDpH0aI15YvPbGNDEd9DYI/@VXBw4h/A7gi0sMymNjWNGF7ZNHMTCY2M3aFEyfBAoO/iWVRsl7BSHhCKv@Ylmf2Bt3NlCsutopj5LGeuwzkvRScOa1KZWpT5im3JhH1YRi4Lpsgx75DvX73cH7Tu4Bh93bwR/cSRgO47fy7C6PrLlwMbu96N90h3I8Gd@rtptPr9/pfoXM@eBjBFQ5Cv3Pbva9UKIaTreSPY0Dmc/sYfBXFY1iiTma3lATmeTh85/mxhHoMhfCxIHdv/c1jwfA5lKRnFCWN0AnnTDwPveYmzL5l4gXaIEWAkkoCRyRGJA6Mh6nlMMs10F3IWLSciYVfhe9KmH71ejh0HsznXGB45gjo8jVkPxvVVmaCNQeDYEybuwv5BGfQrGI8ZSDcrJgU25we@lsIHzLBhXZBhn5kQEFWqXxsjHOmxI6cFD/OvJJu5UBcHOo0EXBmlJAUGi5uAl@gUdUMKohgbjKsN@7MMKZPTFQnJZwdBpbqWwSUHd5hBZJYQIwMyYHnA7LLPGe0ffyISD/V64rqPIoSvRgkJL0wYEY1p6/7R@8GRsj2e@j174jQw8EtdEJe3991L3pXPUyJXl9lQ2f49eG22x/dm1jOL647/a@ULjigOFSFq4f@xag36FMKYSoNh71LSqPOyExUlq37KFbOSs43z5tATuUkWLGVv5k4zA68rWPhnjNh648Zo7Eibvg0kDwO0C6kdsRphRmuFZYLJ@u6NG9Q/68pouA@l9lwh8mGQghgLrg8xxzzywIRUvgSsV1nkkqzxOiMQSXFES@SqgBf2tCAT5/SOoHZlCpPORhyeuDyaO5jMmGceqlkkwjcnD2vOjYqbeiOb1SWchMpK1SxinO@3U6LV97KsBCEo@nCI3DJnSW0i4PqNaKMEkygx6kQNUwG5brVbrTAOktk8OXoKG@DGnu0xlQbUSM@Zcmg7KPvr3vhTrGpEE81N1vuy7Npbkc3rZMPVBihkCEZ4Q4a3Sj4hnhR/pr1WLPRGBeGI/Y2W4X8yE5LM2ZcJL9eZ@lrsquln3MLDEmr/DJ1ZtmFqm9OuIMpgSp8dj7nKQPMlgWR56II1v6fUtuxC6byGpbmWGWOHKpP/Mw@n@a@KtcfHbVKHye4V7y0dBATDcRz4CyNOcPmuHoI1FQDtfbQt8ZBMDMNTCZv4gi2MtlTa7ZK6VNMo3b0cNQcl61JkWrlwaRuKDKeIUWyDNDC5ClbEikRsGxwLDfWC@4OcCjXsYQKGGcrbnQOCs58H12ofTsIabHHqjAXH5OUHB8C@qQBzSa3kb4cUcP3j3yb@m49lo7qaWSN5DnSktb5A5Q8a5Tsl37Zu/SML9G2ziEm2DoT4r0v5eiehMqRWKOXwj05xBznII@47ydDDcOkT/xE5gyzPjs7JU6tecgavPdSh2yCV6pR2GehVZnZaQGqwUFWLffViLcCvR/yLw2kv2bLw3YDscew4uHnbSRfg0TO7FAfiG5MOobDNlC5F/bD/wIb6Nat2532Q6x02dJ@R319Z9k4OH3XOuoLSx66CW10zMrfJnzIvh@Cvd2Xnm8Vs/2Qf@@hcGZb35X71pguu0wfqnba@P4Ee6I1LvCNbtTIOuJfVEFxX8l4m6iqQdKe87KnOm3rkpwBMyc7SgMyqdydaTMj9QRdzr5lEZ08/5@WZBNsV3J/1MxmjErqLS4B6nW6ZRj0b/6Ey97VVXfY7V904VtvdA3JQK8/6g7vhl38Cz24Gjz0Lyv6PvNLVHyjw2oxOK@eRbWnKxKNT77YluTOWoeeTd86n@4q@zr3CPBL0saDVavtPfhGj7Vm8Vyo64/jI1t0fYhK6ZKTmtxbRk76/s9jaOK/347h5Bh@w7ff8e0E//xysmulV6NRY6weN7kLBFyGw/yXfHdPX5nrr7nI53TRn7@HfizEkYJubD4RbPVDu1F2cwIdPvwnzOt4WTmv0y@yj/47O2vqIhId5EOcELRcacKNulBa3rz7CPNIc0WVXlTEHpMxSnKXXGiEkpzUn@ll@llmGx/9/UFat/Zcj8mcC1Toww6jWF11kc5fEueCFlXh@62PLjA1l7ZpXN66Uy1FcF/swi01vFbIAkRGeIE0lwJjULj63VV2lR8/pmD0B6Puae6@9fxPukgdwsXgsvuh@l8 "Java (JDK) ‚Äì Try It Online") using my fixed interpreter.
[Answer]
# [Julia 0.6](http://julialang.org/), 20 bytes
```
n->count_ones(n)%2<1
```
[Try it online!](https://tio.run/##Dcc7CoAwEAXA3lO8RthALOIvjXoVETWwEjYS4/lXp5vrjbyNGjBDpVn29EpZk5wPianbyWlIGQwWUGfhnIX33qL/MwymAu7MUqJQIDamOuVQ/QA "Julia 0.6 ‚Äì Try It Online")
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/) (-O0), ~~¬†36¬†~~ 31 bytes
```
int f(int i){i=!i||i%2-f(i/2);}
```
[Try it online!](https://tio.run/##RYxLDoMgGIT3nmKaponEmFKXgt7FIDR/omAQulHPbpEuOotZfPNQy1K/lTrvZNUURw1Jbg1eD3Nf/NlHq@B8f5INMOXlxDbqbrTv9GjqhJ4NE0fO54FsybAVSDLO/@odFyD54hwCVUUpB5kyDRnDGsa2VS4GSAm6LBNtx0ngyD9eh@gtuCiO8ws "C++ (gcc) ‚Äì Try It Online")
---
# [C++ (clang)](http://clang.llvm.org/), 35 bytes
```
int f(int i){return!i||i%2-f(i/2);}
```
[Try it online!](https://tio.run/##RY07DoMwEER7TjFRFAkLoTiU2OEuyJ9oJbCRMWmAsxNjimwxxZvPqmmq1dC7z3Enp4ZFG0jycwymH7viz75GRR@6g1yELU8ltgYTl@ButG30aOqEnw0Te86MPbmSYS2QzvpwVd5cgOSLcwhUFSUfZMtUZAxz1G2r/BIhJeiUTIzTg8Ced65/4KLYjx8 "C++ (clang) ‚Äì Try It Online")
---
Here is my first attempt at code golfing, hope I didn't break any rule I might have missed.
Edit:  
- Saved 5 bytes thanks to @Jonathan Frech : replaced `!=` by `-` and `return` by `i=` (the last replacement does not seem to work with clang though)  
- Since there seems to be a debate whether I should use gcc -O0 abuse, I thought I could just give both versions
[Answer]
Since the [previous J solution by Adam](https://codegolf.stackexchange.com/a/169775/78410) is invalid for numbers having odd number of binary digits, here is a corrected one:
# [J](http://jsoftware.com/), 8 bytes
```
1-~:/&#:
```
[Try it online!](https://tio.run/##y/qvpKegnqZga6WuoKNQa6VgoADE/w1166z01ZSt/mtypSZn5CukKRjDGKYwhqEhjGVubg5jmiDUmf4HAA "J ‚Äì Try It Online")
Anonymous tacit verb.
### How it works
```
1-~:/&#:    Right argument: the number to test.
      #:    Convert to binary digits
  ~:/&      Reduce by not-equal (same as XOR for zero-one values)
1-          Invert the result
```
Alternatively, J has a built-in `XOR` that computes bitwise XOR over the input.
# [J](http://jsoftware.com/), 8 bytes
```
1-XOR&#:
```
[Try it online!](https://tio.run/##y/qvpKegnqZga6WuoKNQa6VgoADE/w11I/yD1JSt/mtypSZn5CukKRjDGKYwhqEhjGVubg5jmiDUmf4HAA "J ‚Äì Try It Online")
[Answer]
# Ruby, ~~32~~ ~~29~~ ~~28~~ ~~27~~ 21 bytes
```
->n{("%b"%n).sum%2<1}
```
Where we use the fact that `sum` sums each character and given `1` is an odd number, and because we eventually do modulus `2`, that makes it equivalent to `count(?1)`:
```
->n{("%b"%n).count(?1)%2<1}
```
Where `<1` is a shorter substitute for `even?`: 
```
->n{n.to_s(2).count(?1).even?}
```
Where `n` parameter should be an integer.
[Answer]
# Regex (ECMAScript), ~~37~~ 33 bytes
*-4 bytes thanks to Neil's idea of subtracting the least-significant two bits instead of the most-significant two bits*
```
^(((?=(((x*)(?=\5$))*))\3x){2})*$
```
[Try it online!](https://tio.run/##TY/LbsIwEEV/hUYIZkITHi0scA2rLtiwKMvSShYMzrTGsWwDKY9vT8OiUjdXVzpXujpf6qjCxrOLWXC8Jb8v7Tf91F5aOrXeSL9WDuAsZ/20/gSAuWyiSrEp63EbMUVcP1V4Gd0wbddp/4x5LFfRs9WAeTC8IZg8Zs@IIsiBOBVsCMBIT2pr2BIgPkh7MAYvWpo8OMMRulkXBe8ArNS5IatjgbPR9cphqZbA0ikfaGEj6PfBB@IfoP/Azobz4fSOMRa@PCULe1SGty2vrKZpK@kZsSs9CH6RJLjXw@YwqZLckyMVgTHfq7gpwCNeQqfjGqUId4uhcIcYom8m4narB9loPPkF "JavaScript (SpiderMonkey) ‚Äì Try It Online")
Takes its input in unary, as a string of `x` characters whose length represents the number.
```
^
(
    # Subtract the two least-significant "1" bits as
    # they would be in tail's binary representation.
    (
        # Divide tail evenly by 2 as many times as we can, atomically
        (?=
            (((x*)(?=\5$))*)
        )\3
        x                # Subtract a 1 bit
    ){2}
)*                       # Loop as many times as possible...
$                        # and only match if the final result is 0.
```
## Regex (Perl / Java / PCRE / Python / Ruby), 26 bytes
```
^((((x*)(?=\4$))*+x){2})*$
```
[Try it online!](https://tio.run/##RU7LasMwEPyVJYhY6wd@0PRQWYkDybWn3pJUpCUGgZq4kgsuQv11Z@MEuodlZ3Z2Z7qTNYvx6xeYFeDN5fNogOWCoKw367f1MkB7sZw5WYh6KdCDbgmh76w@9zDbn2ciQGOk64zueZRFqfv5cD2dqDQr0xJP3zfR6p8tiMcXplDcfjlyPNrG1BX6xuzKg6ReHMTDVz8g07Wc1jQlCXrdAufREMEAJEIE@Qc5szl65ubzKdyUjYKX4p6VaRFCUGr7ulFqfOdUQ4x8JfdPDDFOBvRVwJiNY5FVi@cr "Perl 5 ‚Äì Try It Online") - Perl  
[Try it online!](https://tio.run/##bVJdb9swDHzvr@CMDpGcVE2KbQ9TjWIbNqDAug3tY5oBii0namXak@TGbZDfnlGO91GgepFIno66E@/Ugzq5K@73pmpqF@COYmFqkUr4P9MGY1/MOb3SHVWOmnZpTQ65Vd7DlTIIWxhyPqhA20NtCqiowm6CM7gC5VZ@vuAQ1q7eePjc5boJpqabRwBfjNVQZqg3/ZElIq8LLaiecPmxLUvtdHGtVaEdLHvY8yT7c3MIS87l0NdPgtysIz9jPluSBlV8NagZ568ybK3lpmRe6F@tsp4lp2maJpxvn0MPDIyFFwm2xBD@MhDBKTEsCXcv/Tgb3eIo7kHuDrndDxWCdgguG06ktmpiA88lubGsa6sVwlNWEqOWcJMrRJJusGkDZBDVDjl28@iDroRBLmHQ2cPEWvlvugv0zN5igMEQS28njgMICTFIHOrzBVgqR5TwjTWBJSf0CYQPgFOqXGKgMXCiUc5rCpidTxd8Ajh7sSisxlVYn5/BBUQkvKdttiDGfK3cfNENevoIZwsJH5xTj16UxlrWTUbdqDcFoKxd1EbPyHAqAc8znNE2HpPAKxXyNTlUEZsT1SFi/eQiDfgnIj9MjNg41bChRV43j9/La4UrTZ2mE@Q8Ki2BVdQeC/Iu/u0TH0yuybGNM0Gz@KlcPmXBtfF//pUb8jCULHntE7KEy11cR3Gq9j8ZrS7l7CK7fXPMeTru@PZsx9PjfZyZ/fTk7O273w "Java (JDK) ‚Äì Try It Online") - Java  
[Try it online!](https://tio.run/##XVDfa8IwEH73rwgh0FxNtRZ1SCy@bIPB2MO2N@tC7VJbVtOQRiiIf3t3lT0tcMf9@r7vcrayw3ZnK0uYIymhc0pmxDp9Uk7bJi80D@azcKdUlTdeFe3Z1o12Gc9AZu/zLhAkQCuxqE56HDBeG99xpZ5fXp@UAkEWgJRILCe1qVWnPae2cHp2zIsf79Cppj7XngpCl8lmuVk/JJsVBTkpW8dZncaSNWmJ7B3/@Hx8eQMJV1KXnDX7zrtGG4wgWhzSlGaGAg53lyN2sCxiES1gxOveNu235jSiAscl4ov2YvyI3SYI2iMB@vggJ4Tclc1fzsw2vfcxmk4BpQm/X@ic@6LizAkUG8@lc8@DPhDMAAC5jivWoIuqHfeSBL@ykGTMCTPyhjK3f2flIIcvjq8Pge/SbMkAwmkP1@QGIRuGOEpW618 "PHP ‚Äì Try It Online") - PCRE  
```
^
(
    # Subtract the two least-significant "1" bits as
    # they would be in tail's binary representation.
    (
        # Divide tail evenly by 2 as many times as we can, atomically
        ((x*)(?=\4$))*+
        x                # Subtract a 1 bit
    ){2}
)*                       # Loop as many times as possible...
$                        # and only match if the final result is 0.
```
## Regex (.NET), 29 bytes
```
^(((?>((x*)(?=\4$))*)x){2})*$
```
[Try it online!](https://tio.run/##ZZBBT@MwFITv/ApTIdWvTaK0WjhgXJAiDkgg0BaJwy5IJn0US64T@TnFNPS3FzcBLvhmzdjzzZSUlpXDnVUrpFqVyObv5HHVNqTtkhWyqCxVBkV/v8fgs7@4bIxyl6F2SKSjQZRGEbFVS155XbJ1pRfsRmnLOLRr5RjJi8HuiXN@PuM8jICfy/9/jgBGEKCdbmF0tBuIvdFJi28sJmDglM2bZ/IuBvNJQtk12qV/TaeQdPpt7ffZWVGtam1wAaL3MiNeKse19czKXHAji4isFtfaIgc4lLYxRlg5gVa/cDvLocgenPbYGzqMWppsXhvt@TAdgtj/pRMUB/FB/cUxm358HEYhu3fvd8oR8vpf/phUTbTCb@n7WTrpPQjfsXxwZdfKxMWcsks8ZW2@HSQGBBrCbr3QjTLvlxiGYaLhp@ImVtRnEoUej5MwllGGSOmyK7pRvnzlAbqem189N3IifhC6zPDFCGLbnV2eTo9PPgE "C# (.NET Core) ‚Äì Try It Online")
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 6 bytes
```
1=/~2\
```
[Try it online!](https://ngn.codeberg.page/k/#eJxFkNtuEzEURd/9FRuBCkiTju/HzijwxhfwVip1GpyLmmZCxqlSIfLt7FERedhjz/I6PtZZzc2ivdgfStX57w93r5fjfAXg3D0MT92nh1W/3XXn7rU7fr7/o+qd68w9F2M6Pa0i8gb8v4MQ3g5ijNNGaTgERGQYDWNhAozAJFgN62A9rMBmOIoOzsNFuAyv4R18gI/wCcEg8B6PIAgJUSM6RN4bERPEQCwkQASSkDSSQwpIESkja2SLHJD5iowLblYf3xmtlVKt2tR6GOdtuxx+lvWwW92OtV8+lfNy0+/X5XY5PLe/TmWs22E/tiZmsb7djrO64Wd/en4sx1l52e6+Hvp1Wfib2j8uXoZaxvfczepwUMph8QXfj6eijJm23/rdWBTn9p/7qxLCVeEErz9KN3ANQoPYIDccJmMZEiNMajhRhpL1DJml56Y6MkfmWOrIPJkn86z1ZJ61wTBTA3qBtYEs0otkcepKL5IJPWFfIRN6QpboJXqJLNFL7JHJMr1Mlqcn5792qI2t)
* `~2\` convert input to base-2 representation, and `not` it (flip `0`s and `1`s)
* `1=/` do an equals-reduce seeded with `1`; returns `1` if there are an odd number of 1's in the inverted base-2 representation and `0` if there are an even number(or none at all)
[Answer]
# [Perl¬†6](https://perl6.org), 21 bytes
```
*.base(2).comb(~1)%%2
```
[Test it](https://tio.run/##Rc7NCoJAEMDx@zzFEBm7ZYKVCi5GHerUMbr7MYG0qbgqRdSLdevFrK3Q2/Kf3wxbUCndtlaEjWvFAuB8xVGcJ4RBO7aiUBGbcSvOzxF72NwwZq3QZFWRqjBAmWakXk9rc1jvBOgz@89AQCHDDCdfJeCYl/@F6RIZ@ie6smGaFXXFTfSbUNbEhnQpKK4o4cjxBoipQv2NHnbCxMEvYrDs6wDu7VyXfVkT2LZ@bkOpCDzP6/qiJ47TkTc "Perl 6 ‚Äì Try It Online")
## Expanded:
```
*\        # WhateverCode lambda (this is the parameter)
.base(2)  # Str representing the binary
.comb(~1) # find the "1"s
%% 2      # is the count of "1"s divisible by 2?
```
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), ~~13~~ 12 bytes
```
Even@Sum@Bin
```
[Try it online!](https://tio.run/##Zc5BC4IwFAfwu5/ioRkaCzITQTBWUVCHCIwuYwexWQOdw82@/prSreN7/P/v/Uqty@rNTJ3l5vhhAhdDi/dcmCtjT0VmUlYv6tx6LvSdKX0oFVOkRkBiBFGEIE1TBBs7JAn95Yi7dGEB6xV1nLrVkOVw6vq21PPMDXwVgq9cjINLx8X4yXt4dehwIYcpegW8hUI2XJNd05zHNbGX/witRjCVqImtxBosYeR8AQ "Attache ‚Äì Try It Online")
(Old 13 bytes: `Even@1&`~@Bin`)
This is a composition of three functions:
1. `Bin`
2. `Sum`
3. `Even`
This checks that the `Sum` of the `Bin`ary expansion of the input is `Even`.
[Answer]
# [dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), 18 16 bytes
```
[2~rd1<M+]dsMx2%
```
Returns (to the stack) 0 for evil and 1 for not evil
[Try it online!](https://tio.run/##S0n@b2L8P9qorijF0MZXOzal2LfCSPV/wX8A "dc ‚Äì Try It Online")
Fairly straightforward - recursively applies the combined quotient/remainder operator `~` to the new quotient and adds all the remainders together, then mods by 2 (after spending two bytes to flip to a standard truthy/falsy).
Edited to reflect consensus that 0 for truthy and 1 for falsy is okay, especially in a language that has no sort of `if(boolean)` construct.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 10 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Anonymous tacit function. Can take any array of integers as argument.
```
‚â†‚åø1‚ç™2‚àò‚ä•‚ç£¬Ø1
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1Hngkc9@w0f9a4yetQx41HX0ke9iw@tN/yf9qhtwqPevkd9Uz39H3U1H1pv/KhtIpAXHOQMJEM8PIP/pykYKxgaKphYGCiYGCuYmgIA "APL (Dyalog Unicode) ‚Äì Try It Online")
`2‚àò‚ä•‚ç£¬Ø1`‚ÄÉconvert to binary, using as many digits as needed by the largest number, separate digits along primary axis
`1‚ç™`‚ÄÉprepend ones along the primary axis
`‚â†‚åø`‚ÄÉXOR reduction along the primary axis
[Answer]
# Python 2, 29 bytes
```
lambda n:~bin(n).count('1')&1
```
[Try it online!](https://tio.run/##K6gsycjPM/r/PycxNyklUSHPqi4pM08jT1MvOb80r0RD3VBdU83wf5otXnkurrT8IoWS1OIShcw8BQ1jHQVDQx0Fc3NzHQUTIMfUVNOKi7OgKDOvRCFNA6RM8z8A "Python 2 ‚Äì Try It Online")
Returns 1 if True, else 0.
Converts the number to a binary string like '0b11', counts the number of 1s, gets the complement of result, and returns the last bit of the complement (thanks, [<https://codegolf.stackexchange.com/users/53560/cdlane>](https://codegolf.stackexchange.com/users/53560/cdlane)!) (1 if the original number was even, 0 if it was odd).
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 14 bytes
```
ThueMorse@#<1&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/T8kozTVN7@oONVB2cZQ7b@@g0K1sY6CoaGOgrm5uY6CCZBjaqqjYGZoBiTMzGpj/wMA "Wolfram Language (Mathematica) ‚Äì Try It Online")
The Nth element of the Thue-Morse sequence is 1 if the number of binary digits in N is odd, and 0 otherwise.
]