The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A372641 Number of defective (binary) heaps on n elements from the set {0,1} where exactly n ancestor-successor pairs do not have the correct order. 2
1, 0, 0, 0, 0, 1, 2, 2, 9, 11, 36, 71, 151, 306, 591, 1228, 2469, 4966, 10025, 19591, 38946, 75977, 148585, 291027, 579981, 1152385, 2280696, 4470814, 8817933, 17244969, 33819425, 65976444, 129933731, 254791662, 499516984, 977417823, 1914394157, 3745482924 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
LINKS
Eric Weisstein's World of Mathematics, Heap
Wikipedia, Binary heap
FORMULA
a(n) = A372640(n,n).
EXAMPLE
a(5) = 1: 00111.
a(6) = 2: 000111, 001111.
a(7) = 2: 0011111, 0101111.
a(8) = 9: 00010111, 00011011, 00011101, 00011110, 00101111, 00111011, 00111101, 01001111, 01011111.
a(9) = 11: 000011101, 000011110, 001001111, 001010011, 001101111, 001110011, 001111101, 001111110, 010001111, 010111111, 011011111.
(The examples use max-heaps.)
MAPLE
b:= proc(n, t) option remember; `if`(n=0, 1, (g-> (f->
expand(b(f, t)*b(n-1-f, t)*x^t+b(f, t+1)*b(n-1-f, t+1)
))(min(g-1, n-g/2)))(2^ilog2(n)))
end:
a:= n-> coeff(b(n, 0), x, n):
seq(a(n), n=0..37);
MATHEMATICA
b[n_, t_] := b[n, t] = If[n == 0, 1, Function[g, Function [f,
Expand[b[f, t]*b[n-1-f, t]*x^t + b[f, t+1]*b[n-1-f, t+1]]][
Min[g-1, n-g/2]]][2^(Length@IntegerDigits[n, 2]-1)]];
a[n_] := Coefficient[b[n, 0], x, n];
Table[a[n], {n, 0, 37}] (* Jean-François Alcover, May 09 2024, after Alois P. Heinz *)
CROSSREFS
Main diagonal of A372640.
Sequence in context: A193726 A143022 A154100 * A002880 A225465 A248665
KEYWORD
nonn
AUTHOR
Alois P. Heinz, May 08 2024
STATUS
approved

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 June 12 19:52 EDT 2024. Contains 373360 sequences. (Running on oeis4.)