Odious Number Calculator
Check whether a number has an odd count of ones in its binary expansion, with the bits shown.
What it does
An odious number is a nonnegative integer whose binary expansion contains an odd number of ones. The sequence begins 1, 2, 4, 7, 8, 11 and 13. The name was chosen as a counterpart to the evil numbers, which have an even count of ones.
The property is about the base 2 representation. Four is written 100 in binary, with a single one, so it is odious. Six is 110, with two ones, so it is not.
Together the two families partition the nonnegative integers, and the parity of the binary digit sum is the bit that generates the Thue Morse sequence. This makes them useful in combinatorics and in problems about fair division.
This page converts the input to binary, counts the ones and reports the verdict together with the bit string so the count is transparent.
The input limit is one trillion, and the conversion stays exact and immediate throughout the range.
How to use
- Enter a whole number n from 0 to 1,000,000,000,000.
- Read the classification in the main result box.
- Check the binary expansion beside it.
- Count the ones yourself to confirm the result.
- The default n = 1 reproduces the worked example.
- Try n = 4 to see a power of two that is odious.
Formula
- n
- The nonnegative integer being classified.
- binary
- The base 2 expansion of n.
- ones
- The count of digit 1 in that expansion.
Zero has no ones and is therefore not odious. Every power of two has exactly one binary one, so all powers of two are odious. The classification depends only on parity of the count.
Worked example
Example: n = 1
The page opens with n = 1.
- Write 1 in binary: it is 1.
- Count the ones: there is one.
- One is an odd number.
- The tool reports ones 1, binary 1, and Odious.
- For 3 the binary form is 11 with two ones, so the verdict would be Evil.
- For 4 the binary form is 100 with one one, also odious.
Reference table
| n | Binary | Ones | Odious |
|---|---|---|---|
| 0 | 0 | 0 | No |
| 1 | 1 | 1 | Yes |
| 2 | 10 | 1 | Yes |
| 4 | 100 | 1 | Yes |
| 7 | 111 | 3 | Yes |
| 8 | 1000 | 1 | Yes |
Limits
- Only nonnegative integers are accepted.
- Inputs above one trillion are rejected to keep the output short.
- The classification is base 2 specific.
- The tool gives a verdict, not a position in the sequence.
Common mistakes
- Counting decimal digits instead of binary digits.
- Treating zero as odious.
- Confusing odious with evil numbers.
- Assuming every odd number is odious.
- Including leading zeros in the count.
Try it yourself
Quick checks. Answers sit tucked under each question.
Is 1 odious?
Yes. Its binary form 1 has one one.
Is 4 odious?
Yes. Its binary form 100 has one one.
Is 6 odious?
No. Its binary form 110 has two ones, so it is evil.
Questions
What does odious mean here?
It is a name for numbers with an odd binary digit sum.
What is the opposite family?
Evil numbers have an even number of ones.
Are powers of two odious?
Yes, each has exactly one binary one.
Is zero odious?
No, it has zero ones.
Are results exact?
Yes, binary conversion is exact.
What input range is accepted?
Whole numbers from 0 through 1,000,000,000,000.