Gould's sequence is an integer sequence named after Henry W. Gould that counts how many odd numbers are in each row of Pascal's triangle. It consists only of powers of two, and begins:
For instance, the sixth number in the sequence is 4, because there are four odd numbers in the sixth row of Pascal's triangle (the four bold numbers in the sequence 1, 5, 10, 10, 5, 1).
The nth value in the sequence (starting from n = 0) gives the highest power of 2 that divides the central binomial coefficient , and it gives the numerator of (expressed as a fraction in lowest terms).
Gould's sequence also gives the number of live cells in the nth generation of the Rule 90 cellular automaton starting from a single live cell. It has a characteristic growing sawtooth shape that can be used to recognize physical processes that behave similarly to Rule 90.
The binary logarithms (exponents in the powers of two) of Gould's sequence themselves form an integer sequence,
in which the nth value gives the number of nonzero bits in the binary representation of the number n, sometimes written in mathematical notation as . Equivalently, the nth value in Gould's sequence is
Taking the sequence of exponents modulo two gives the Thue–Morse sequence.
The partial sums of Gould's sequence,
count all odd numbers in the first n rows of Pascal's triangle. These numbers grow proportionally to , but with a constant of proportionality that oscillates between 0.812556... and 1, periodically as a function of log n.
The first 2i values in Gould's sequence may be constructed by recursively constructing the first 2i − 1 values, and then concatenating the doubles of the first 2i − 1 values. For instance, concatenating the first four values 1, 2, 2, 4 with their doubles 2, 4, 4, 8 produces the first eight values. Because of this doubling construction, the first occurrence of each power of two 2i in this sequence is at position 2i − 1.
Gould's sequence, the sequence of its exponents, and the Thue–Morse sequence are all self-similar: they have the property that the subsequence of values at even positions in the whole sequence equals the original sequence, a property they also share with some other sequences such as Stern's diatomic sequence. In Gould's sequence, the values at odd positions are double their predecessors, while in the sequence of exponents, the values at odd positions are one plus their predecessors.
The sequence is named after Henry W. Gould, who studied it in the early 1960s. However, the fact that these numbers are powers of two, with the exponent of the nth number equal to the number of ones in the binary representation of n, was already known to J. W. L. Glaisher in 1899.
Proving that the numbers in Gould's sequence are powers of two was given as a problem in the 1956 William Lowell Putnam Mathematical Competition.