A296062 Base-2 logarithm of the number of different shapes of balanced binary trees with n nodes (A110316).
0, 0, 1, 0, 2, 2, 2, 0, 3, 4, 5, 4, 5, 4, 3, 0, 4, 6, 8, 8, 10, 10, 10, 8, 10, 10, 10, 8, 8, 6, 4, 0, 5, 8, 11, 12, 15, 16, 17, 16, 19, 20, 21, 20, 21, 20, 19, 16, 19, 20, 21, 20, 21, 20, 19, 16, 17, 16, 15, 12, 11, 8, 5, 0, 6, 10, 14, 16, 20, 22, 24, 24, 28
Offset: 0
References
- Hsien-Kuei Hwang, S, Janson, T.-H. Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968, 2022.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..16383 (first 10001 terms from Robert Israel)
- Pieter C. Allaart and Kiko Kawamura, The Takagi Function: a Survey, Real Analysis Exchange, pp. 1-54, Vol. 37, No. 1, 2011-12.
- T. M. Coronado and F. Rosselló, The minimum value of the Colless index, arXiv:1903.11670 [q-bio.PE], 2019. - _Francesc Rosselló_, Apr 08 2019
- T. M. Coronado et. al, On the minimum value of the Colless index and the bifurcating trees that achieve it, Journal of Mathematical Biology, pp. 1993-2054, Vol. 80, 2020.
- M. Kruppel, On the extrema and the improper derivatives of Takagi’s continuous nowhere differentiable function, pp. 41-59, Rostock. Math. Kolloq.,Vol. 62, 2007.
- Jeffrey C. Lagarias, The Takagi function and its properties, arXiv:1112.4205 [math.CA], 2011-2012.
- Jeffrey C. Lagarias, The Takagi function and its properties, In Functions in number theory and their probabilistic aspects, 153--189, RIMS Kôkyûroku Bessatsu, B34, Res. Inst. Math. Sci. (RIMS), Kyoto, 2012. MR3014845.
- Laura Monroe, A Few Identities of the Takagi Function on Dyadic Rationals, arXiv:2111.05996 [math.CO], 2021.
- Laura Monroe, Takagi Function Identities on Dyadic Rationals, J. Int. Seq (2024) Vol. 27, Art. 24.2.7.
- Wikipedia, Blancmange curve
Programs
-
Maple
a:= proc(n) option remember; local r; `if`(n<2, 0, `if`(irem(n, 2, 'r')=0, 1+a(r)+a(r-1), a(r)*2)) end: seq(a(n), n=0..100); # Alois P. Heinz, Dec 04 2017
-
Mathematica
Fold[Append[#1, If[EvenQ@ #2, #1[[#2/2 + 1]] + #1[[#2/2]] + 1, 2 #1[[(#2 - 1)/2 + 1]]]] &, {0, 0}, Range[2, 72]] (* Michael De Vlieger, Dec 04 2017 *)
-
PARI
seq(n)={my(v=vector(n)); for(m=2, #v, v[m]=vecmin(vector(m\2, i, v[i] + v[m-i] + m-2*i))); v} \\ Andrew Howroyd, Nov 04 2018
-
PARI
seq(n)={my(v=vector(n)); for(n=1, n-1, v[n+1]=if(n%2, 2*v[(n+1)/2], v[n/2] + v[n/2+1] + 1)); v} \\ Andrew Howroyd, Nov 04 2018
-
Python
def A296062(n): return (k:=n+1)-(sum(i.bit_count() for i in range(1,k))<<1)+k*(m:=k.bit_length())-(1<
Chai Wah Wu, Mar 02 2023
Formula
a(0) = a(1) = 0; a(2*n) = a(n) + a(n-1) + 1; a(2*n+1) = 2*a(n).
2^a(n) = A110316(n).
G.f. g(x) satisfies g(x) = (1+x)^2*g(x^2) + x^2/(1-x^2). - Robert Israel, Dec 04 2017
a(n) = min_{i=1..floor((n+1)/2)} n + 1 - 2*i + a(i-1) + a(n-i). - Qingnian Su and Andrew Howroyd, Nov 04 2018
a(n) = Sum_{j=2..k} (m_1-m_j-2*(j-2))*2^m_j where m_1 > ... > m_k are the exponents in the binary expansion of n. - Francesc Rosselló, Apr 08 2019
From Laura Monroe, Oct 23 2020: (Start)
a(n+1) = (2^k)*tau(x/(2^k)), where tau is the Takagi function, and n = (2^k) + x with x < 2^k.
a(n) = n - A268289(n). (End)
Comments