Evil Number

A number in which the first decimal digits of the fractional part sum to 666 is known as an evil number (Pegg and Lomont 2004).

However, the term "evil" is also used to denote nonnegative integers that have an even number of 1s in their binary expansions, the first few of which are 0, 3, 5, 6, 9, 10, 12, 15, 17, 18, 20, ... (OEIS A001969), illustrated above as a binary plot. Numbers that are not evil are then known as odious numbers.

Returning to Pegg's definition of evil, the fact that is evil was noted by Keith, while I. Honig (pers. comm., May 9, 2004) noted that the golden ratio is also evil. The following table gives a list of some common evil numbers (Pegg and Lomont 2004).

The probability of the digits of a given real number summing to a relatively large positive integer is roughly given by the number of nonzero digits divided by sum of those digits, namely . Amazingly, the exact probability for summing to a number can be computed exactly using the recursive formulas

(1) (2)

For , 2, ..., the first few values are therefore 1/9, 10/81, 100/739, 1000/6561, ... (OEIS A100061 and A100062; Pegg and Lomont 2004), plotted above.

The generating function for this series is given by

(3)

(Pegg and Lomont 2004). This allows an expression for to be determined in closed form, although it is a complicated expression involving combinations of the algebraic numbers (and polynomial roots) .

For the case of interest ( ), the result is a rational number having a 635-digit numerator and a 636-digit denominator that is approximately equal to

(4)

A set of "beastly evil" numbers are given by the following (M. Hudson, pers. comm., Nov 5-10, 2004).

number digits 74 74 136 142 146 147 149 152 156 159 163 468 655 2018

Powers of that are evil include , 6, 8, 10, 17, 18, 24, 25, 26, 29, 30, 38, ... (M. Hudson, pers. comm., Nov. 8, 2004).

The analogous problem of terms in a simple continued fraction summing to a given number can also be considered. The following table summarized some constants whose continued fractions have cumulative sums that equal 666 (Pegg and Lomont 2004).

Interestingly, this makes the cube line picking average length and doubly evil.