login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078903 a(n) = n^2 - Sum_{u=1..n} Sum_{v=1..u} valuation(2*v, 2). 4

%I #40 Feb 03 2024 19:19:59

%S 0,0,1,1,2,3,5,5,6,7,9,10,12,14,17,17,18,19,21,22,24,26,29,30,32,34,

%T 37,39,42,45,49,49,50,51,53,54,56,58,61,62,64,66,69,71,74,77,81,82,84,

%U 86,89,91,94,97,101,103,106,109,113,116,120,124,129,129,130,131,133,134

%N a(n) = n^2 - Sum_{u=1..n} Sum_{v=1..u} valuation(2*v, 2).

%C This is a fractal generator sequence. Let Fr(m,n) = m*n - a(n); then the graph of Fr(m,n) for 1 <= n <= 4^(m+1) - 3 presents fractal aspects.

%H Ivan Neretin, <a href="/A078903/b078903.txt">Table of n, a(n) for n = 1..10000</a>

%H Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf">Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications</a>, preprint, 2016.

%H Hsien-Kuei Hwang, Svante Janson, Tsung-Hsi Tsai, <a href="http://doi.org/10.1145/3127585">Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications</a>, ACM Transactions on Algorithms 13:4 (2017), #47.

%H Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences with (relatively) simple generating functions</a>, 2004.

%H Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions (ps file)</a>.

%H Ralf Stephan, <a href="/A067699/a067699.pdf">Table of generating functions (pdf file)</a>.

%F a(n) = n^2 - Sum_{k=1..n} A005187(k);

%F a(n) = n^2 - Sum_{u=1..n} Sum_{v=1..u} A001511(v);

%F a(n+1) - a(n) = A048881(n).

%F G.f.: 1/(1-x)^2 * ((x(1+x)/(1-x) - Sum_{k>=0} x^2^k/(1-x^2^k))). - _Ralf Stephan_, Apr 12 2002

%F a(0) = 0, a(2*n) = a(n) + a(n-1) + n - 1, a(2*n+1) = 2*a(n) + n. Also, a(n) = A000788(n) - n. - _Ralf Stephan_, Oct 05 2003

%e Fr(1, n) for 1 <= n <= 4^2-3 = 13 gives 1, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 2, 1.

%e Fr(2, n) for 1 <= n <= 4^3-3 = 63 gives 2, 4, 5, 7, 8, 9, 9, 11, 12, 13, 13, 14, 14, 14, 13, 15, 16, 17, 17, 18, 18, 18, 17, 18, 18, 18, 17, 17, 16, 15, 13, 15, 16, 17, 17, 18, 18, 18, 17, 18, 18, 18, 17, 17, 16, 15, 13, 14, 14, 14, 13, 13, 12, 11, 9, 9, 8, 7, 5, 4, 2.

%p a:= proc(n) option remember; `if`(n=0, 0,

%p a(n-1)-1+add(i, i=Bits[Split](n)))

%p end:

%p seq(a(n), n=1..68); # _Alois P. Heinz_, Feb 03 2024

%t Accumulate@Table[DigitCount[n, 2, 1] - 1, {n, 68}] (* _Ivan Neretin_, Sep 07 2017 *)

%o (PARI) a(n)=n^2-sum(u=1,n,sum(v=1,u,valuation(2*v,2)))

%o (Magma) [n^2-(&+[ &+[Valuation(2*v,2):v in [1..u]]:u in [1..n]]):n in [1..70]]; // _Marius A. Burtea_, Oct 24 2019

%Y Cf. A078904, A073504.

%Y Equals (1/2) * A076178(n).

%K nonn

%O 1,5

%A _Benoit Cloitre_, Dec 12 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 01:12 EDT 2024. Contains 372388 sequences. (Running on oeis4.)