The I Ching, the Book of Changes, is built on sixty-four hexagrams: figures of six lines, each line either broken or unbroken. Sixty-four is not a chosen number. Two possibilities in each of six positions gives two to the sixth power, and the set of sixty-four is therefore complete and closed. There is no sixty-fifth hexagram to find.
The system is built up in stages that the tradition itself describes: two states, then four images, then eight trigrams, then sixty-four hexagrams formed by stacking trigrams in pairs. The eight trigrams are attributed to the legendary Fu Xi and the hexagram texts to King Wen and the Duke of Zhou, attributions which are traditional rather than historical. The core text dates to the Western Zhou, roughly the ninth century BCE, as a divination manual; the Ten Wings, the philosophical commentaries that turned it into a work of cosmology, are later, and Confucian association with it is later still.
Two orderings of the hexagrams are standard and they are quite different. The King Wen sequence is the received order of the text, arranged in pairs where each hexagram is the inversion or complement of its partner, and no rule generating the whole sequence has ever been established. The Fu Xi or binary sequence, arranged by systematically varying the lines, is the one Leibniz recognised in 1703 as identical to binary counting from 0 to 63 when broken lines are read as zero and unbroken as one. Leibniz took this as evidence of an ancient insight; historians of Chinese mathematics generally regard the binary ordering as a later arrangement, associated with Shao Yong in the eleventh century, rather than an original feature.