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-8 of 8 results.

A118387 Record values in A079300 (number of shortest addition chains of n).

Original entry on oeis.org

1, 2, 5, 15, 33, 40, 132, 220, 352, 1258, 2661, 3903, 9787, 12989, 17961, 31373, 33076, 55262, 110624
Offset: 1

Views

Author

David W. Wilson, Apr 26 2006

Keywords

Comments

Computed by Neill M. Clift. Verified up to a(17) by David W. Wilson.

References

Crossrefs

Formula

a(n) = A079300(A118386(n)).

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

A079301 a(n) = number of shortest addition chains for n that are Brauer chains.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 5, 1, 3, 4, 15, 3, 9, 14, 4, 1, 2, 7, 31, 6, 26, 40, 4, 4, 13, 22, 5, 23, 114, 12, 64, 1, 2, 4, 43, 12, 33, 87, 18, 8, 20, 78, 4, 69, 14, 8, 183, 5, 11, 34, 4, 35, 171, 16, 139, 32, 148, 308, 33, 24, 76, 201, 80, 1, 2, 4, 23, 6, 26, 134, 1014
Offset: 1

Views

Author

David W. Wilson, Feb 09 2003

Keywords

Comments

In a general addition chain, each element > 1 is a sum of two previous elements. In a Brauer chain, each element > 1 is a sum of the immediately previous element and another previous element.

Examples

			All five of the shortest addition chains for 7 are Brauer chains: (1,2,3,4,7), (1,2,3,5,7), (1,2,3,6,7), (1,2,4,5,7), (1,2,4,6,7). Hence a(7) = 5.
13 has ten shortest addition chains: (1,2,3,5,8,13), (1,2,3,5,10,13), (1,2,3,6,7,13), (1,2,3,6,12,13), (1,2,4,5,9,13), (1,2,4,6,7,13), (1,2,4,6,12,13), (1,2,4,8,9,13), (1,2,4,8,12,13), and (1,2,4,5,8,13). Of these, all but the last are Brauer chains. Hence a(13) = 9.
12509 has 28 shortest addition chains, none of which are Brauer chains. Hence a(12509) = 0.
		

Extensions

Definition disambiguated by Glen Whitney, Nov 06 2021

A079302 a(n) = number of shortest addition chains for n that are non-Brauer chains.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 1, 2, 0, 0, 18, 0, 13, 0, 0, 0, 0, 0, 6, 5, 2, 0, 3, 6, 0, 0, 0, 0, 37, 0, 1, 2, 0, 3, 34, 0, 17, 0, 25, 44, 4, 0, 15, 32, 7, 0, 0, 0, 0, 0, 3, 0, 244, 0, 7, 13, 2, 8, 0, 6, 129, 0, 3, 6
Offset: 1

Views

Author

David W. Wilson, Feb 09 2003

Keywords

Comments

In a general addition chain, each element > 1 is a sum of two previous elements (the two may be the same element). In a Brauer chain, each element > 1 is a sum of the immediately previous element and another previous element. Conversely, a non-Brauer chain has at least one element that is the sum of two elements earlier than the preceding one.

Examples

			7 has five shortest addition chains: (1,2,3,4,7), (1,2,3,5,7), (1,2,3,6,7), (1,2,4,5,7), and (1,2,4,6,7). All of these are Brauer chains. Hence a(7) = 0.
13 has ten shortest addition chains: (1,2,3,5,8,13), (1,2,3,5,10,13), (1,2,3,6,7,13), (1,2,3,6,12,13), (1,2,4,5,9,13), (1,2,4,6,7,13), (1,2,4,6,12,13), (1,2,4,8,9,13), (1,2,4,8,12,13), and (1,2,4,5,8,13). Of these, only the last is non-Brauer. Hence a(13) = 1.
12509 has 28 shortest addition chains, all of which happen to be non-Brauer (in fact, it is the smallest natural number for which all shortest addition chains are non-Brauer). Hence a(12509) = A079300(12509) = 28.
		

Crossrefs

Cf. A079300, the total number of minimal addition chains.

Extensions

Definition disambiguated by Glen Whitney, Nov 06 2021

A008057 Smallest sum of an addition chain for 2n+1.

Original entry on oeis.org

0, 5, 10, 16, 20, 27, 31, 35, 40, 47, 51, 56, 60, 65, 74, 78, 80, 86, 92, 96, 102, 106, 110, 120, 121, 125, 134, 137, 142, 148, 153, 156, 160, 167, 171, 182, 184, 185, 192, 201, 200, 206, 210, 219, 227, 231, 233, 237, 241, 245
Offset: 0

Views

Author

N. J. A. Sloane, Aug 07 2003

Keywords

Examples

			The smallest chain for 5 is 2, 3, 5 with sum a(2) = 2+3+5 = 10.
The smallest chain for 7 is 2, 3, 4, 7 with sum a(3) = 2+3+4+7 = 16.
		

Crossrefs

Programs

  • PARI
    step(V)=my(U=List(),v); for(i=1,#V, v=V[i]; for(i=1,#v, for(j=i,#v, if(v[i]+v[j]>v[#v], listput(U, concat(v, v[i]+v[j])))))); vecsort(Vec(U),,8)
    sm(v)=sum(i=2,#v,v[i])
    a(n)=if(n<2,return(5*n)); n=2*n+1; my(V=[[1,2]],U,t); while(#(U=select(v->v[#v]==n,V))==0, V=select(v->v[#v]<=n,step(V))); t=vecmin(apply(sm,U)); while(#V, V=step(select(v->sm(v)Charles R Greathouse IV, Jul 17 2013

Formula

a(n) = A376449(2*n+1) + 2*n. - Pontus von Brömssen, Apr 22 2025

Extensions

a(30)-a(46) from Sean A. Irvine, Mar 08 2018
a(47)-a(49) (using A376449 b-file) from Pontus von Brömssen, Apr 22 2025

A118386 Numbers k such that k has a record number of distinct shortest addition chains.

Original entry on oeis.org

1, 5, 7, 11, 19, 22, 29, 47, 58, 71, 127, 142, 191, 446, 508, 607, 758, 1087, 1214
Offset: 1

Views

Author

David W. Wilson, Apr 26 2006

Keywords

Comments

Computed by Neill M. Clift. Verified up to a(17) by David W. Wilson. Indices of record values of A079300.

Crossrefs

A186435 Number of evaluation schemes for x^n achieving the minimal number of multiplications.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 6, 1, 3, 4, 19, 3, 10, 16, 4, 1, 2, 7, 37, 6, 31, 48, 4, 4, 14, 24, 5, 26, 152, 12, 80, 1, 2, 4, 51, 12, 39, 100, 20, 8, 23, 90, 4, 81, 14, 8, 242, 5, 12, 36, 4, 38, 215, 16, 172, 36, 190, 395, 40, 24
Offset: 1

Views

Author

Laurent Thevenoux and Christophe Mouilleron, Feb 23 2011

Keywords

Examples

			For n=7, we can evaluate x^7 using only 4 multiplications in 6 ways:
x^2 = x * x ; x^3 = x   * x^2 ; x^4 = x   * x^3 ; x^7 = x^3 * x^4
x^2 = x * x ; x^3 = x   * x^2 ; x^4 = x^2 * x^2 ; x^7 = x^3 * x^4
x^2 = x * x ; x^3 = x   * x^2 ; x^5 = x^2 * x^3 ; x^7 = x^2 * x^5
x^2 = x * x ; x^3 = x   * x^2 ; x^6 = x^3 * x^3 ; x^7 = x   * x^6
x^2 = x * x ; x^4 = x^2 * x^2 ; x^5 = x   * x^4 ; x^7 = x^2 * x^5
x^2 = x * x ; x^4 = x^2 * x^2 ; x^6 = x^2 * x^4 ; x^7 = x   * x^6
		

Crossrefs

See A003313 for the minimal number of multiplications to evaluate x^n.
See A001190 for the total number of evaluation schemes for x^n (regardless of the number of effective multiplications).
A079300 gives the number of minimal chains (= sequences of powers of x) ending at x^n. This is actually a bit less than the number of evaluation schemes since two schemes may produce the same chain, like the first and second schemes in the example above, where the corresponding chain is (x^2, x^3, x^4, x^7).

A086833 Minimum number of different addends occurring in any shortest addition chain of Brauer type for a given n, or 0 if n has no shortest addition chain of Brauer type.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 4, 3, 4, 5, 4, 4, 4, 3, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 5, 5, 4, 6, 5, 4, 6, 4, 5, 5, 5, 5, 5, 5, 4, 4, 5, 4, 5, 5, 5, 5, 5, 4, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 7, 5, 5, 6, 4, 6, 7, 5, 6, 7, 5, 6, 6, 5, 5, 7, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5
Offset: 1

Views

Author

Tatsuru Murai, Aug 08 2003

Keywords

Comments

n = 12509 is the first n for which a(n) = 0 because it is the smallest number that has no shortest addition chain of Brauer type. - Hugo Pfoertner, Jun 10 2006 [Edited by Pontus von Brömssen, Apr 25 2025]

Examples

			a(23)=5 because 23=1+1+2+1+4+9+5 is the shortest addition chain for 23.
For n=9 there are A079301(9)=3 different shortest addition chains, all of Brauer type:
[1 2 3 6 9] -> 9=1+1+1+3+3 -> 2 different addends {1,3}
[1 2 4 5 9] -> 9=1+1+2+1+4 -> 3 different addends {1,2,4}
[1 2 4 8 9] -> 9=1+1+2+4+1 -> 3 different addends {1,2,4}
The minimum number of different addends is 2, therefore a(9)=2.
		

Crossrefs

Formula

a(n) = 0 if and only if n is in A349044. - Pontus von Brömssen, Apr 25 2025

Extensions

Edited by Hugo Pfoertner, Jun 10 2006
Escape clause added by Pontus von Brömssen, Apr 25 2025
Showing 1-8 of 8 results.