In mathematics, an addition chain for computing a positive integer n can be given by a sequence of natural numbers v and a sequence of index pairs w such that each term in v is the sum of two previous terms, the indices of those terms being specified by w:
Contents
v =(v0,...,vs), with v0 = 1 and vs = nfor each 0< i ≤ s holds: vi = vj + vk, with wi=(j,k) and 0 ≤ j,k ≤ i − 1Often only v is given since it is easy to extract w from v, but sometimes w is not uniquely reconstructible. The length of an addition chain is the number of sums needed to express all its numbers, which is one less than the cardinality of the sequence of numbers. An introduction is given by Knuth.
Examples
As an example: v = (1,2,3,6,12,24,30,31) is an addition chain for 31 of length 7, since
2 = 1 + 13 = 2 + 16 = 3 + 312 = 6 + 624 = 12 + 1230 = 24 + 631 = 30 + 1Addition chains can be used for addition-chain exponentiation: so for example we only need 7 multiplications to calculate 531:
52 = 51 × 5153 = 52 × 5156 = 53 × 53512 = 56 × 56524 = 512 × 512530 = 524 × 56531 = 530 × 51Methods for computing addition chains
Calculating an addition chain of minimal length is not easy; a generalized version of the problem, in which one must find a chain that simultaneously forms each of a sequence of values, is NP-complete. There is no known algorithm which can calculate a minimal addition chain for a given number with any guarantees of reasonable timing or small memory usage. However, several techniques to calculate relatively short chains exist. One very well known technique to calculate relatively short addition chains is the binary method, similar to exponentiation by squaring. Other well-known methods are the factor method and window method.
Chain length
Let
where
It is clear that l(2n) ≤ l(n)+1. Strict inequality is possible, as l(382) = l(191) = 11, observed by Knuth.
The first integer with l(2n) < l(n) is n = 375494703, which is followed by 602641031, 619418303, and so on (sequence A230528 in the OEIS).
Brauer chain
A Brauer chain or star addition chain is an addition chain in which one of the summands is always the previous chain: that is,
for each k>0: ak = ak-1 + aj for some j < k.A Brauer number is one for which the Brauer chain is minimal.
Brauer proved that
l*(2n−1) ≤ n − 1 + l*(n)where
Scholz conjecture
The Scholz conjecture (sometimes called the Scholz–Brauer or Brauer–Scholz conjecture), named after A. Scholz and Alfred T. Brauer), is a conjecture from 1937 stating that
l(2n − 1) ≤ n − 1 + l(n) .It is known to be true for Hansen numbers, a generalization of Brauer numbers; N. Clift checked by computer that all n≤5784688 are Hansen (while 5784689 is not). Clift further checked that is true with equality for n≤64.