# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a005766
Showing 1-1 of 1
%I A005766 M2448 #28 Feb 28 2019 11:47:15
%S A005766 0,1,3,5,9,12,18,21,29,34,44,48,60,67,81,85,101,110,128,134,154,165,
%T A005766 187,192,216,229,255,263,291,306,336,341,373,390,424,434,470,489,527,
%U A005766 534,574,595,637,649,693,716,762,768,816,841,891,905,957,984,1038
%N A005766 a(n) = cost of minimal multiplication-cost addition chain for n.
%D A005766 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A005766 T. D. Noe, Table of n, a(n) for n = 1..1000
%H A005766 J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197, ex. 21.
%H A005766 R. L. Graham, A. C.-C. Yao, F. F. Yao, Addition chains with multiplicative cost Discrete Math. 23 (1978), 115-119.
%H A005766 R. L. Graham et al., Addition chains with multiplicative cost [Cached copy]
%H A005766 R. Stephan, Some divide-and-conquer sequences ...
%H A005766 R. Stephan, Table of generating functions
%H A005766 Index to sequences related to the complexity of n
%F A005766 a(2n)=a(n)+n^2, a(2n+1)=a(n)+n(n+2). - _Ralf Stephan_, May 04 2003
%F A005766 G.f.: 1/(1-x) * sum(k>=0, x^2^(k+1)(1+2x^2^k-x^2^(k+1))/(1-x^2^(k+1))^2). - _Ralf Stephan_, Jul 27 2003
%F A005766 a(n) = sum(k=1, n, A007814(n) + 2*A025480(n-1)). - _Ralf Stephan_, Oct 30 2003
%t A005766 a[n_] := Sum[v = IntegerExponent[k, 2]; v + k/2^v - 1, {k, 1, n}];
%t A005766 Array[a, 55] (* _Jean-François Alcover_, Feb 28 2019 *)
%o A005766 (PARI) a(n)=if(n<1,0,if(n%2==0,a(n/2)+n^2/4,a((n-1)/2)+(n-1)*(n+3)/4))
%o A005766 (PARI) a(n)=sum(k=1,n,valuation(k,2)+k/2^valuation(k,2)-1)
%Y A005766 Partial sums of A089265.
%K A005766 nonn
%O A005766 1,3
%A A005766 _N. J. A. Sloane_, _Jeffrey Shallit_, _Robert G. Wilson v_
%E A005766 More terms from _Ralf Stephan_, May 04 2003
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE