A117632 Number of 1's required to build n using {+,T} and parentheses, where T(i) = i*(i+1)/2.
1, 2, 2, 3, 4, 2, 3, 4, 4, 3, 4, 4, 5, 6, 4, 5, 6, 6, 7, 6, 2, 3, 4, 4, 5, 6, 4, 3, 4, 5, 5, 6, 6, 5, 6, 4, 5, 6, 6, 7, 8, 4, 5, 6, 4, 5, 6, 6, 5, 6, 6, 7, 8, 8, 3, 4, 5, 5, 6, 7, 5, 6, 6, 7, 6, 4, 5, 6, 6, 7, 8, 6, 7, 8, 8, 5, 6, 4, 5, 6, 6, 7, 6, 6, 7, 8, 6, 7, 8, 8, 5, 6, 7, 7, 8, 9, 7, 8, 6, 7, 8, 8
Offset: 1
Keywords
Examples
a(1) = 1 because "1" has a single 1. a(2) = 2 because "1+1" has two 1's. a(3) = 2 because 3 = T(1+1) has two 1's. a(6) = 2 because 6 = T(T(1+1)). a(10) = 3 because 10 = T(T(1+1)+1). a(12) = 4 because 12 = T(T(1+1)) + T(T(1+1)). a(15) = 4 because 15 = T(T(1+1)+1+1). a(21) = 2 because 21 = T(T(T(1+1))). a(28) = 3 because 28 = T(T(T(1+1))+1). a(55) = 3 because 55 = T(T(T(1+1)+1)).
References
- W. A. Beyer, M. L. Stein and S. M. Ulam, The Notion of Complexity. Report LA-4822, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, 1971.
- R. K. Guy, Unsolved Problems Number Theory, Sect. F26.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
- W. A. Beyer, M. L. Stein and S. M. Ulam, The Notion of Complexity. Report LA-4822, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, December 1971. [Annotated scanned copy]
- R. K. Guy, Some suspiciously simple sequences, Amer. Math. Monthly 93 (1986), 186-190; 94 (1987), 965; 96 (1989), 905.
- Ed Pegg, Jr., Integer Complexity.
- Eric Weisstein's World of Mathematics, Integer Complexity.
- Wikipedia, Optimal substructure.
Crossrefs
Programs
-
Maple
a:= proc(n) option remember; local m; m:= floor (sqrt (n*2)); if n<3 then n elif n=m*(m+1)/2 then a(m) else min (seq (a(i)+a(n-i), i=1..floor(n/2))) fi end: seq (a(n), n=1..110); # Alois P. Heinz, Jan 05 2011
-
Mathematica
a[n_] := a[n] = Module[{m = Floor[Sqrt[n*2]]}, If[n < 3, n, If[n == m*(m + 1)/2, a[m], Min[Table[a[i] + a[n - i], {i, 1, Floor[n/2]}]]]]]; Array[a, 110] (* Jean-François Alcover, Jun 02 2018, from Maple *)
Extensions
I do not know how many of these entries have been proved to be minimal. - N. J. A. Sloane, Apr 15 2006
Corrected and extended by Alois P. Heinz, Jan 05 2011
Comments