[math-fun] addition-multiplication chains
Awfully quiet around here lately. Everyone busy with their Halloween preparations? I've been playing with Addition-Multiplication chains (AMchains). These are like addition chains, but you can use multiplication too. Each chain entry is the sum or product of two earlier entries. You begin with 1; squaring is allowed. The goal is to come up with the minimal chain for a number. I've decided for coding purposes that the entries must always increase, but it's not a part of the definition. Some examples: 3141: 1 2 4 5 16 25 625 3125 3141 (9 links) 31415: 1 2 3 5 10 100 103 300 305 31415 (10 links) 314159: 1 2 4 8 64 68 69 137 4416 4553 314157 314159 (12 links) It seems like the number of links should be somewhere between O(logN) and O(logN/loglogN). The smallest numbers that require each chain size are 1 1 1 2 2 1 2 3 3 1 2 3 5 4 1 2 3 5 7 5 1 2 3 4 7 13 6 1 2 3 4 9 13 23 7 1 2 3 4 5 20 23 59 8 1 2 3 4 7 8 56 59 211 9 1 2 3 4 7 14 15 210 211 619 10 1 2 3 4 7 8 11 56 616 619 4282 11 1 2 3 4 7 8 56 57 65 4225 4282 Chains seem to have a lot of equivalents, available by playing around with the terms. For example, the sequence X, X^2, X^2 + X can also be done as X, X+1, X^2+X. The table of minimal chain lengths is pretty boring. 0 01233445445556654556566755656667566656666767767766 50 67776777786777566767786776777865666777776777886776 100 67777778677778787788767776776778788778887887677778 ... 1000 78888889888989899999899967787889788989997889899989 1050 8998997889899989999A998999999989989999778888998889 1100 898988889998999A899988899788898999889999899999999A The short-chain value 2^10 = 1024 causes only a minor disturbance in the pattern. The shortest chains for 2^K always seem to be 2^(minimal addition chain). Rich
participants (1)
-
Schroeppel, Richard