cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 13 results. Next

A003313 Length of shortest addition chain for n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 5, 5, 6, 5, 6, 6, 6, 5, 6, 6, 6, 6, 7, 6, 7, 5, 6, 6, 7, 6, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 8, 6, 7, 7, 7, 7, 8, 7, 8, 7, 8, 8, 8, 7, 8, 8, 8, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 8, 8, 8, 8, 9, 7, 8, 8, 8, 8, 8, 8, 9, 8, 9, 8, 9, 8, 9, 9, 9, 7, 8, 8, 8, 8
Offset: 1

Views

Author

Keywords

Comments

Equivalently, minimal number of multiplications required to compute the n-th power.

Examples

			For n < 149 and for many higher values of n, a(n) is the depth of n in a tree whose first 6 levels are shown below. The path from the root of the tree to n gives an optimal addition chain. (See Knuth, Vol. 2, Sect. 4.6.3, Fig. 14 and Ex. 5.)
                  1
                  |
                  2
                 / \
                /   \
               /     \
              /       \
             /         \
            3           4
           / \           \
          /   \           \
         /     \           \
        /       \           \
       5         6           8
      / \        |         /   \
     /   \       |        /     \
    7    10      12      9       16
   /    /  \    /  \    /  \    /  \
  14   11  20  15  24  13  17  18  32
E.g., a(15) = 5 and an optimal chain for 15 is 1, 2, 3, 6, 12, 15.
It is not possible to extend the tree to include the optimal addition chains for all n. For example, the chains for 43, 77, and 149 are incompatible. See the link to Achim Flammenkamp's web page on addition chains.
		

References

  • Hatem M. Bahig, Mohamed H. El-Zahar, and Ken Nakamula, Some results for some conjectures in addition chains, in Combinatorics, computability and logic, pp. 47-54, Springer Ser. Discrete Math. Theor. Comput. Sci., Springer, London, 2001.
  • D. Bleichenbacher and A. Flammenkamp, An Efficient Algorithm for Computing Shortest Addition Chains, Preprint, 1997.
  • A. Flammenkamp, Drei Beitraege zur diskreten Mathematik: Additionsketten, No-Three-in-Line-Problem, Sociable Numbers, Diplomarbeit, Bielefeld 1991.
  • S. B. Gashkov and V. V. Kochergin, On addition chains of vectors, gate circuits and the complexity of computations of powers [translation of Metody Diskret. Anal. No. 52 (1992), 22-40, 119-120; 1265027], Siberian Adv. Math. 4 (1994), 1-16.
  • A. A. Gioia and M. V. Subbarao, The Scholz-Brauer problem in addition chains, II, in Proceedings of the Eighth Manitoba Conference on Numerical Mathematics and Computing (Univ. Manitoba, Winnipeg, Man., 1978), pp. 251-274, Congress. Numer., XXII, Utilitas Math., Winnipeg, Man., 1979.
  • D. E. Knuth, The Art of Computer Programming, vol. 2, Seminumerical Algorithms, 2nd ed., Fig. 14 on page 403; 3rd edition, 1998, p. 465.
  • D. E. Knuth, website, further updates to Vol. 2 of TAOCP.
  • Michael O. Rabin and Shmuel Winograd, "Fast evaluation of polynomials by rational preparation." Communications on Pure and Applied Mathematics 25.4 (1972): 433-458. See Table p. 455.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Formula

a(n*m) <= a(n)+a(m). In particular, a(n^k) <= k * a(n). - Max Alekseyev, Jul 22 2005
For all n >= 2, a(n) <= (4/3)*floor(log_2 n) + 2. - Jonathan Vos Post, Oct 08 2008
From Achim Flammenkamp, Oct 26 2016: (Start)
a(n) <= 9/log_2(71) log_2(n), for all n.
It is conjectured by D. E. Knuth, K. Stolarsky et al. that for all n: floor(log_2(n)) + ceiling(log_2(v(n))) <= a(n). (End)
a(n) <= A014701(n). - Charles R Greathouse IV, Jan 03 2018
From Szymon Lukaszyk, Apr 05 2024: (Start)
For n = 2^s, a(n)=s;
for n = 2^s + 2^m, m in [0..s-1] (A048645), a(n)=s+1;
for n = 2^s + 3*2^m, m in [0..s-2] (A072823), a(n)=s+2;
for n = 2^s + 7*2^(s-3), s>2 (A072823), a(n)=s+2.(End)

Extensions

More terms from Jud McCranie, Nov 01 2001

A003065 Number of integers with a shortest addition chain of length n.

Original entry on oeis.org

1, 1, 2, 3, 5, 9, 15, 26, 44, 78, 136, 246, 432, 772, 1382, 2481, 4490, 8170, 14866, 27128, 49544, 90371, 165432, 303475, 558275, 1028508, 1896704, 3501029, 6465774, 11947258, 22087489, 40886910, 75763102, 140588339, 261070184, 485074788, 901751654, 1677060520
Offset: 0

Views

Author

Keywords

Examples

			a(6) = 15 because 15 numbers have shortest addition chains involving 6 additions. These numbers are 19,21,22,23,25,26,27,28,30,33,34,36,40,48,64.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 2, p. 459.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • See A003313 for a much more extensive list of references and links.

Crossrefs

Cf. A114623 [Number of integers for which Knuth's power tree method produces an addition chain of length n].

Extensions

Updated through a(28) from Achim Flammenkamp's web site Feb 01 2005
a(28) corrected from 6465773 to 6465774, based on information received from Neill M. Clift. - Hugo Pfoertner, Jan 29 2006
a(29)-a(30) from Neill M. Clift, Jun 15 2007
a(31)-a(33) from Neill M. Clift, May 21 2008
b-file up to a(38) extracted from Achim Flammenkamp's web site. R. J. Mathar, May 14 2013
b-file updated to a(44) from Achim Flammenkamp's web site. Glen Whitney, Nov 09 2021

A383001 Smallest number with shortest addition-multiplication chain of length n.

Original entry on oeis.org

1, 2, 3, 5, 7, 13, 23, 59, 211, 619, 4282, 25819
Offset: 0

Views

Author

Pontus von Brömssen, Apr 12 2025

Keywords

Comments

Indices of records in A230697.

Crossrefs

Formula

A230697(a(n)) = n.

A383332 Smallest positive weight of a pair of nonnegative integers with a shortest vectorial addition chain of length n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 12, 20, 29, 44, 70, 104
Offset: 0

Views

Author

Pontus von Brömssen, Apr 26 2025

Keywords

Comments

See A383330 for details.
The weight of a pair is the sum of its elements.

Examples

			   n | a(n) | pairs (x,y) with x <= y, x+y = a(n), and shortest chain length n
  ---+------+-----------------------------------------------------------------
   0 |   1  | (0,1)
   1 |   2  | (0,2), (1,1)
   2 |   3  | (0,3), (1,2)
   3 |   4  | (1,3)
   4 |   6  | (1,5)
   5 |   8  | (1,7)
   6 |  12  | (1,11)
   7 |  20  | (1,19), (3,17)
   8 |  29  | (6,23)
   9 |  44  | (7,37)
  10 |  70  | (11,59)
  11 | 104  | (15,89)
		

Crossrefs

Row 2 of A383334.

A384484 Smallest number with shortest addition-composition chain of length n, starting with 1 and x, i.e., smallest k such that A384483(k) = n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 19, 70, 167, 1239, 7123
Offset: 0

Views

Author

Pontus von Brömssen, Jun 02 2025

Keywords

Comments

See A384480 and A384483 for details.

Crossrefs

Cf. A003064 (addition only), A383001 (addition and multiplication), A384385 (addition, multiplication, and composition), A384480, A384481, A384483, A384485.

A105096 Length of shortest Lucas chain for n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 6, 5, 6, 5, 6, 6, 7, 5, 6, 6, 6, 6, 7, 6, 7, 5, 7, 7, 7, 6, 8, 7, 7, 6, 8, 7, 8, 7, 7, 8, 8, 6, 8, 7, 8, 7, 9, 7, 8, 7, 8, 8, 9, 7, 9, 8, 8, 6, 8, 8, 9, 8, 9, 8, 9, 7, 9, 9, 8, 8, 9, 8, 9, 7, 8, 9, 10, 8, 9, 9, 9
Offset: 1

Views

Author

N. J. A. Sloane, May 23 2008

Keywords

Comments

Lucas chains are addition chains with additional requirements on the presence of differences between members of the chain. Therefore a(n) >= A003313(n) and A104892(n) <= A003064(n). Shortest simple Lucas chains are constrained even further (forbid duplication between adjacent members). Therefore a(n) <= A105195(n). - R. J. Mathar, May 24 2008

Crossrefs

Extensions

Offset changed to 1 and more terms from Jinyuan Wang, Apr 18 2025

A115617 Smallest number for which Knuth's power tree method produces an addition chain of length n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 19, 29, 47, 71, 127, 191, 319, 551, 1007, 1711, 2687, 4703, 8447, 15179, 28079, 45997, 89599, 138959, 257513, 485657, 834557, 1433501, 2854189, 4726127, 8814047, 15692153, 30078877, 53574623, 94189807, 177848059, 322928189
Offset: 0

Views

Author

Hugo Pfoertner, Jan 29 2006

Keywords

Comments

Minimum number in row of power tree A114622. The first 12 terms are identical with A003064.
Smallest k such that A383329(k) = n. - Pontus von Brömssen, Apr 24 2025

Crossrefs

Cf. A114622 (the power tree (as defined by Knuth)), A003064 (smallest number with addition chain of length n), A113945 (numbers such that Knuth's power tree method produces a result deficient by 1).
Indices of records in A383329.

Extensions

a(28)-a(32) from Hugo Pfoertner, Sep 05 2015
a(33) from Hugo Pfoertner, Oct 01 2015
a(34)-a(36) from Michael S. Branicky, Apr 30 2024
a(0) from Pontus von Brömssen, Apr 24 2025

A383142 Smallest positive integer with shortest addition-subtraction chain of length n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 19, 29, 53, 87, 151, 267, 461, 811, 1383, 2357, 4277, 7499, 14003, 25931, 44269, 87773, 152947, 271563
Offset: 0

Views

Author

Jinyuan Wang, Apr 17 2025

Keywords

Examples

			a(8) = 53 because 53 is the smallest positive integer k such that A128998(k) = 8. An example of a shortest addition-subtraction chain for 53 is (1 2 3 4 7 14 25 28 53). a(8) > A003064(8) because an optimal chain for A003064(8) = 47 has length 7: (1 2 3 6 12 24 23 47).
		

Crossrefs

Formula

a(n) >= A003064(n).

A383334 Square array read by antidiagonals: T(n,k) is the smallest positive weight of an n-tuple of nonnegative integers with a shortest vectorial addition chain of length k; n >= 1, k >= 0.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 5, 3, 2, 1, 7, 4, 3, 2, 1, 11, 6, 4, 3, 2, 1, 19, 8, 5, 4, 3, 2, 1, 29, 12, 7, 5, 4, 3, 2, 1, 47, 20, 9, 6, 5, 4, 3, 2, 1, 71, 29, 13, 8, 6, 5, 4, 3, 2, 1, 127, 44, 20, 10, 7, 6, 5, 4, 3, 2, 1, 191, 70, 30, 14, 9, 7, 6, 5, 4, 3, 2, 1
Offset: 1

Views

Author

Pontus von Brömssen, Apr 26 2025

Keywords

Comments

See A383333 for details.
T(n,k) is the smallest positive degree of a monomial x_1^e_1*...*x_n^e_n that requires k multiplications, given x_1, ..., x_n.

Examples

			Array begins:
  n\k| 0  1  2  3  4  5  6  7  8
  ---+--------------------------
  1  | 1  2  3  5  7 11 19 29 47
  2  | 1  2  3  4  6  8 12 20 29
  3  | 1  2  3  4  5  7  9 13 20
  4  | 1  2  3  4  5  6  8 10 14
  5  | 1  2  3  4  5  6  7  9 11
The smallest positive weight of a triple of nonnegative integers with a shortest addition chain of length 8 is T(3,8) = 20. Up to permutations, (3,4,13) is the only such triple, with a shortest addition chain [(1,0,0), (0,1,0), (0,0,1),] (0,0,2), (0,0,4), (0,1,4), (1,1,4), (2,2,8), (3,3,12), (3,3,13), (3,4,13).
		

Crossrefs

Cf. A383333.
Rows: A003064 (n=1), A383332 (n=2).

A383336 Smallest number with shortest addition-multiplication-exponentiation chain of length n.

Original entry on oeis.org

1, 2, 3, 5, 7, 13, 23, 79, 214, 1418, 5991
Offset: 0

Views

Author

Pontus von Brömssen, Apr 27 2025

Keywords

Comments

For n >= 1, the largest number with shortest addition-multiplication-exponentiation chain of length n is A173566(n).

Examples

			a(7) = 79 because all smaller numbers have addition-multiplication-exponentiation chains of length at most 6, but the shortest chain for 79 has length 7. One such chain is (1, 2, 3, 5, 32, 37, 42, 79). (There are also such chains that do not use exponentiation, such as (1, 2, 3, 4, 5, 15, 75, 79).)
		

Crossrefs

Showing 1-10 of 13 results. Next