%I #14 Apr 15 2018 21:49:42
%S 0,1,2,1,2,3,2,1,2,3,4,3,4,3,2,1,2,3,4,3,4,4,4,3,4,4,4,3,4,3,2,1,2,3,
%T 4,3,4,5,4,3,4,5,5,4,4,4,4,3,4,4,4,4,5,5,4,3,4,5,4,3,4,3,2,1,2,3,4,3,
%U 4,5,4,3,4,5,4,4,5,5,4,3,4,5,5,4,4,5,6,5,5,5,5,4,4,4,4,3,4,4,4
%N Minimal number of shift, add and subtract operations to multiply by n.
%H Doug Grundman and Sean A. Irvine, <a href="/A008342/b008342.txt">Table of n, a(n) for n = 1..1024</a>
%H Sean A. Irvine, <a href="/A008342/a008342.out.txt">Example minimal sequences for n = 1..1024</a>
%e For n = 7 (a simple case), x8 = x1 << 3, x7 = x8 - x1 for a total of 2 operations.
%e For n = 22 (requires reusing an expression), x8 = x1 << 3, x7 = x8 - x1, x15 = x7 + x8, x22 = x15 + x7 for a total of 4 operations.
%e For n = 597 (a tricky case), x4 = x1 << 2, x5 = x4 + x1, x80 = x5 << 4, x85 = x80 + x5, x512 = x1 << 9, x597 = x512 + x85 for a total of 6 operations.
%K nonn,nice
%O 1,3
%A dg(AT)franklin.com (Doug Grundman)