cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 14 results. Next

A003095 a(n) = a(n-1)^2 + 1 for n >= 1, with a(0) = 0.

Original entry on oeis.org

0, 1, 2, 5, 26, 677, 458330, 210066388901, 44127887745906175987802, 1947270476915296449559703445493848930452791205, 3791862310265926082868235028027893277370233152247388584761734150717768254410341175325352026
Offset: 0

Views

Author

Keywords

Comments

Number of binary trees of height less than or equal to n. [Corrected by Orson R. L. Peters, Jan 03 2020]
The rightmost digits cycle (0,1,2,5,6,7,0,1,2,5,6,7,...). - Jonathan Vos Post, Jul 21 2005
Apart from the initial term, a subsequence of A008318. - Reinhard Zumkeller, Jan 17 2008
Partial sums of A001699. - Jonathan Vos Post, Feb 17 2010
Corresponds to the second and second last diagonals of A119687. - John M. Campbell, Jul 25 2011
This is a divisibility sequence. - Michael Somos, Jan 01 2013
Sum_{n>=1} 1/a(n) = 1.739940825174794649210636285335916041018367182486941... . - Vaclav Kotesovec, Jan 30 2015
From Vladimir Vesic, Oct 03 2015: (Start)
Forming Herbrand's domains of formula: (∃x)(∀y)(∀z)(∃k)(P(x)∨Q(y)∧R(k))
where: x->a
k->f(y,z)
we get:
H0 = {a}
H1 = {a, f(a,a)}
H2 = {a, f(a,a), f(a,f(a,a)), f(f(a,a),a), f(f(a,a),f(a,a))}
...
The number of elements in each domain follows this sequence.
(End)
It is an open question whether or not this sequence satisfies Benford's law [Berger-Hill, 2017] - N. J. A. Sloane, Feb 07 2017
This is a strong divisibility sequence; see A329429. - Clark Kimberling, Nov 13 2019
From Peter Bala, Oct 31 2022: (Start)
Let k be a positive integer. Clearly, the sequence obtained by reducing a(n) modulo k is eventually periodic. Conjectures:
1) The sequence obtained by reducing a(n) modulo 2^k is eventually periodic with period 2.
2) The sequence obtained by reducing a(n) modulo 10^k is eventually periodic with period 6 (the case k = 1 is noted above).
3) The sequence obtained by reducing a(n) modulo 20^k is eventually periodic with period 6.
4) For n >= floor(k/2) and for 1 <= i <= 6, the value of a(6*n+i) mod 10^k is a constant independent of n. The digits of these 6 constant integers, when read from right to left, are the first k digits of the 10-adic numbers A318135 (i = 1), A318136 (i = 2), A318137 (i = 3), A318138 (i = 4), A318139 (i = 5) and A318140 (i = 6), respectively. An example is given below.
n a(6*n+1) mod 10^11
1 10066388901
2 72084948901
3 67988948901
4 61588948901
5 01588948901
6 01588948901
7 01588948901
... ...
A318135 begins 1, 0, 9, 8, 4, 9, 8, 8, 5, 1, 0, 2, .... (End)

References

  • Mordechai Ben-Ari, Mathematical Logic for Computer Science, Third edition, 173-203.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 443-448.
  • R. K. Guy, How to factor a number, Proc. 5th Manitoba Conf. Numerical Math., Congress. Num. 16 (1975), 49-89.
  • R. Penrose, The Emperor's New Mind, Oxford, 1989, p. 122.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A137560, which enumerates binary trees of height less than n and exactly j leaf nodes. - Robert Munafo, Nov 03 2009

Programs

Formula

a(n) = B_{n-1}(1) where B_n(x) = 1 + x*B_{n-1}(x)^2 is the generating function of trees of height <= n.
a(n) is asymptotic to c^(2^n) where c=1.2259024435287485386279474959130085213... (see A076949). - Benoit Cloitre, Nov 27 2002
c = b^(1/4) where b is the constant in Bottomley's formula in A004019. a(n) appears very asymptotic to c^(2^n) - Sum_{k>=1} A088674(k)/(2*c^(2^n))^(2*k-1). - Gerald McGarvey, Nov 17 2007
a(n) = Sum_{i=1..n} A001699(i). - Jonathan Vos Post, Feb 17 2010
G.f. = x + 2*x^2 + 5*x^3 + 26*x^4 + 677*x^5 + 458330*x^6 + 210066388901*x^7 + ... . - Michael Somos, Jan 01 2013
a(2n) mod 2 = 0 ; a(2n+1) mod 2 = 1. - Altug Alkan, Oct 04 2015
a(n) + a(n-1) = A213437(n). - Peter Bala, Feb 03 2017
0 = a(n)^2*(+a(n+1) + a(n+2)) + a(n+1)^2*(-a(n+1) - a(n+2) - a(n+3)) + a(n+2)^3 for all n>=0. - Michael Somos, Feb 10 2017
a(n) = A091980(2^(n-1)) for n > 0. - Alois P. Heinz, Jul 11 2019

Extensions

Additional comments from Cyril Banderier, Jun 05 2000
Minor edits by Vaclav Kotesovec, Oct 04 2014
Initial term clarified by Clark Kimberling, Nov 13 2019

A309049 Number T(n,k) of (binary) max-heaps on n elements from the set {0,1} containing exactly k 0's; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 3, 3, 2, 1, 1, 1, 3, 4, 4, 2, 1, 1, 1, 4, 6, 6, 5, 2, 1, 1, 1, 4, 7, 8, 7, 5, 2, 1, 1, 1, 5, 10, 12, 11, 8, 5, 2, 1, 1, 1, 5, 11, 16, 17, 13, 9, 5, 2, 1, 1, 1, 6, 15, 23, 27, 24, 16, 10, 5, 2, 1, 1, 1, 6, 16, 27, 34, 34, 27, 18, 11, 5, 2, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Jul 09 2019

Keywords

Comments

Also the number T(n,k) of (binary) min-heaps on n elements from the set {0,1} containing exactly k 1's.
The sequence of column k satisfies a linear recurrence with constant coefficients of order A063915(k).

Examples

			T(6,0) = 1: 111111.
T(6,1) = 3: 111011, 111101, 111110.
T(6,2) = 4: 110110, 111001, 111010, 111100.
T(6,3) = 4: 101001, 110010, 110100, 111000.
T(6,4) = 2: 101000, 110000.
T(6,5) = 1: 100000.
T(6,6) = 1: 000000.
T(7,4) = T(7,7-3) = A000108(3) = 5: 1010001, 1010010, 1100100, 1101000, 1110000.
Triangle T(n,k) begins:
  1;
  1, 1;
  1, 1,  1;
  1, 2,  1,  1;
  1, 2,  2,  1,  1;
  1, 3,  3,  2,  1,  1;
  1, 3,  4,  4,  2,  1,  1;
  1, 4,  6,  6,  5,  2,  1,  1;
  1, 4,  7,  8,  7,  5,  2,  1,  1;
  1, 5, 10, 12, 11,  8,  5,  2,  1, 1;
  1, 5, 11, 16, 17, 13,  9,  5,  2, 1, 1;
  1, 6, 15, 23, 27, 24, 16, 10,  5, 2, 1, 1;
  1, 6, 16, 27, 34, 34, 27, 18, 11, 5, 2, 1, 1;
  ...
		

Crossrefs

Columns k=0-10 give: A000012, A110654, A114220 (for n>0), A326504, A326505, A326506, A326507, A326508, A326509, A326510, A326511.
Row sums give A091980(n+1).
T(2n,n) gives A309050.
Rows reversed converge to A000108.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, (g-> (f-> expand(
          x^n+b(f)*b(n-1-f)))(min(g-1, n-g/2)))(2^ilog2(n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n)):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Function[g, Function[f, Expand[x^n + b[f]*b[n - 1 - f]]][Min[g - 1, n - g/2]]][2^Floor[Log[2, n]]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n]];
    T /@ Range[0, 14] // Flatten (* Jean-François Alcover, Oct 04 2019, after Alois P. Heinz *)

Formula

Sum_{k=0..n} k * T(n,k) = A309051(n).
Sum_{k=0..n} (n-k) * T(n,k) = A309052(n).
Sum_{k=0..2^n-1} T(2^n-1,k) = A003095(n+1).
Sum_{k=0..2^n-1} (2^n-1-k) * T(2^n-1,k) = A024358(n).
Sum_{k=0..n} (T(n,k) - T(n-1,k)) = A168542(n).
T(m,m-n) = A000108(n) for m >= 2^n-1 = A000225(n).
T(2^n-1,k) = A202019(n+1,k+1).

A004019 a(0) = 0; for n > 0, a(n) = (a(n-1) + 1)^2.

Original entry on oeis.org

0, 1, 4, 25, 676, 458329, 210066388900, 44127887745906175987801, 1947270476915296449559703445493848930452791204, 3791862310265926082868235028027893277370233152247388584761734150717768254410341175325352025
Offset: 0

Views

Author

Keywords

Comments

Take the standard rooted binary tree of depth n, with 2^(n+1) - 1 labeled nodes. Here is a picture of the tree of depth 3:
R
/ \
/ \
/ \
/ \
/ \
o o
/ \ / \
/ \ / \
o o o o
/ \ / \ / \ / \
o o o o o o o o
Let the number of rooted subtrees be s(n). For example, for n = 1 the s(2) = 4 subtrees are:
R R R R
/ \ / \
o o o o
Then s(n+1) = 1 + 2*s(n) + s(n)^2 = (1+s(n))^2 and so s(n) = a(n+1).

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Mordechai Ben-Ari, Mathematical Logic for Computer Science, Third edition, 173-203.

Crossrefs

Programs

  • Haskell
    a004019 n = a004019_list !! n
    a004019_list = iterate (a000290 . (+ 1)) 0
    -- Reinhard Zumkeller, Feb 01 2013
    
  • Magma
    [n le 1 select 0 else  (Self(n-1)+1)^2: n in [1..15]]; // Vincenzo Librandi, Oct 05 2015
    
  • Mathematica
    Table[Nest[(1 + #)^2 &, 0, n], {n, 0, 12}] (* Vladimir Joseph Stephan Orlovsky, Jul 20 2011 *)
    NestList[(#+1)^2&,0,10] (* Harvey P. Dale, Oct 08 2011 *)
  • PARI
    a(n) = if(n==0, 0, (a(n-1) + 1)^2);
    vector(20, n, a(n-1)) \\ Altug Alkan, Oct 06 2015

Formula

a(n) = A003095(n)^2 = A003095(n+1) - 1 = A056207(n+1) + 1.
It follows from Aho and Sloane that there is a constant c such that a(n) is the nearest integer to c^(2^n). In fact a(n+1) = nearest integer to b^(2^n) - 1 where b = 2.25851845058946539883779624006373187243427469718511465966.... - Henry Bottomley, Aug 30 2005
a(n) is the number of root ancestral configurations for fully symmetric matching gene trees and species trees with 2^n leaves, a(n) = A355108(2^n). - Noah A Rosenberg, Jun 22 2022

Extensions

One more term from Henry Bottomley, Jul 24 2000
Additional comments from Max Alekseyev, Aug 30 2005

A373451 Number T(n,k) of (binary) heaps of length n whose element set equals [k]; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 3, 2, 0, 1, 5, 7, 3, 0, 1, 9, 23, 23, 8, 0, 1, 14, 55, 92, 70, 20, 0, 1, 24, 147, 386, 502, 320, 80, 0, 1, 34, 281, 1004, 1861, 1880, 985, 210, 0, 1, 54, 633, 3128, 8113, 12008, 10237, 4690, 896, 0, 1, 79, 1241, 8039, 27456, 54900, 66730, 48650, 19600, 3360
Offset: 0

Views

Author

Alois P. Heinz, Jun 05 2024

Keywords

Comments

These heaps may contain repeated elements. Their element sets are gap-free and contain 1 (if nonempty).
T(n,k) is defined for n,k >= 0. The triangle contains only the terms with k<=n. T(n,k) = 0 for k>n.

Examples

			T(4,1) = 1: 1111.
T(4,2) = 5: 2111, 2121, 2211, 2212, 2221.
T(4,3) = 7: 3121, 3211, 3212, 3221, 3231, 3312, 3321.
T(4,4) = 3: 4231, 4312, 4321.
(The examples use max-heaps.)
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,  1;
  0, 1,  3,   2;
  0, 1,  5,   7,    3;
  0, 1,  9,  23,   23,    8;
  0, 1, 14,  55,   92,   70,    20;
  0, 1, 24, 147,  386,  502,   320,    80;
  0, 1, 34, 281, 1004, 1861,  1880,   985,  210;
  0, 1, 54, 633, 3128, 8113, 12008, 10237, 4690, 896;
  ...
		

Crossrefs

Columns k=0-4 give A000007, A057427, A091980(n+1)-2, A376962, A376963.
Row sums give A373452.
Row maxima give A373608.
Main diagonal gives A056971.
First lower diagonal gives A373496.
T(2n,n) gives A373500.
Antidiagonal sums give A373632.
Antidiagonal maxima give A373897.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n=0, 1,
         (g-> (f-> add(b(f, j)*b(n-1-f, j), j=1..k)
                 )(min(g-1, n-g/2)))(2^ilog2(n)))
        end:
    T:= (n, k)-> add(binomial(k, j)*(-1)^j*b(n, k-j), j=0..k):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    b[n_, k_] := b[n, k] = If[n == 0, 1,
       Function[g, Function[f, Sum[b[f, j]*b[n-1-f, j], {j, 1, k}]][
          Min[g-1, n-g/2]]][2^(Length@IntegerDigits[n, 2]-1)]];
    T[n_, k_] := Sum[Binomial[k, j]*(-1)^j*b[n, k-j], {j, 0, k}];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Sep 20 2024, after Alois P. Heinz *)

Formula

T(n,k) = Sum_{j=0..k} binomial(k,j) * (-1)^j * A373449(n,k-j).
Sum_{k=0..n} (-1)^k * T(n,n-k) = A019590(n+1).

A372640 Number T(n,k) of defective (binary) heaps on n elements from the set {0,1} where k ancestor-successor pairs do not have the correct order; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 1, 7, 4, 3, 2, 11, 6, 7, 5, 2, 1, 16, 13, 12, 8, 10, 3, 2, 26, 22, 23, 14, 21, 10, 9, 2, 1, 36, 36, 39, 33, 33, 28, 26, 13, 9, 2, 1, 56, 54, 67, 61, 60, 59, 56, 37, 34, 11, 13, 2, 2, 81, 99, 111, 96, 117, 112, 107, 96, 76, 53, 36, 20, 14, 4, 2
Offset: 0

Views

Author

Alois P. Heinz, May 08 2024

Keywords

Comments

T(n,k) is the number of bit vectors v of length n having exactly k pairs (i,j) in {1,...,n} X {1,...,floor(log_2(i))} such that v[i] > v[floor(i/2^j)].
T(n,0) counts perfect (binary) heaps on n elements from the set {0,1}.
T(n,k) is defined for all n>=0 and k>=0. The triangle displays only positive terms. All other terms are zero.

Examples

			T(4,0) = 7: 0000, 1000, 1010, 1100, 1101, 1110, 1111.
T(4,1) = 4: 0010, 0100, 1001, 1011.
T(4,2) = 3: 0001, 0101, 0110.
T(4,3) = 2: 0011, 0111.
(The examples use max-heaps.)
Triangle T(n,k) begins:
   1;
   2;
   3,  1;
   5,  2,   1;
   7,  4,   3,  2;
  11,  6,   7,  5,   2,   1;
  16, 13,  12,  8,  10,   3,   2;
  26, 22,  23, 14,  21,  10,   9,  2,  1;
  36, 36,  39, 33,  33,  28,  26, 13,  9,  2,  1;
  56, 54,  67, 61,  60,  59,  56, 37, 34, 11, 13,  2,  2;
  81, 99, 111, 96, 117, 112, 107, 96, 76, 53, 36, 20, 14, 4, 2;
  ...
		

Crossrefs

Columns k=0-1 give: A091980(n+1), A372643.
Row sums give A000079.
Main diagonal gives A372641.
T(2,n) gives A372642.

Programs

  • 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:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..14);
  • 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)]];
    T[n_] := CoefficientList[b[n, 0], x];
    Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, May 09 2024, after Alois P. Heinz *)

A370484 Number T(n,k) of defective (binary) heaps on n elements from the set {0,1} with k defects; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 1, 7, 6, 3, 11, 11, 9, 1, 16, 20, 24, 4, 26, 32, 52, 16, 2, 36, 60, 100, 52, 8, 56, 100, 192, 120, 40, 4, 81, 162, 351, 300, 111, 18, 1, 131, 255, 631, 627, 313, 77, 13, 1, 183, 427, 1067, 1311, 821, 241, 41, 5, 287, 692, 1856, 2484, 1894, 764, 184, 28, 3
Offset: 0

Views

Author

Alois P. Heinz, May 06 2024

Keywords

Comments

A defect in a defective heap is a parent-child pair not having the correct order.
T(n,k) is the number of bit vectors v of length n having exactly k indices i in [n] such that v[i] > v[floor(i/2)].
T(n,0) counts perfect (binary) heaps on n elements from the set {0,1}.
T(n,k) is defined for all n>=0 and k>=0. The triangle displays only positive terms. All other terms are zero.

Examples

			T(4,0) = 7: 0000, 1000, 1010, 1100, 1101, 1110, 1111.
T(4,1) = 6: 0001, 0010, 0100, 0101, 1001, 1011.
T(4,2) = 3: 0011, 0110, 0111.
(The examples use max-heaps.)
Triangle T(n,k) begins:
    1;
    2;
    3,   1;
    5,   2,    1;
    7,   6,    3;
   11,  11,    9,    1;
   16,  20,   24,    4;
   26,  32,   52,   16,   2;
   36,  60,  100,   52,   8;
   56, 100,  192,  120,  40,   4;
   81, 162,  351,  300, 111,  18,  1;
  131, 255,  631,  627, 313,  77, 13, 1;
  183, 427, 1067, 1311, 821, 241, 41, 5;
  ...
		

Crossrefs

Columns k=0-1 give: A091980(n+1), A372628.
Row sums give A000079.
T(2n,n) gives A372489.

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, (g-> (f->
          expand(b(f, 1)*b(n-1-f, 1)*t+b(f, x)*b(n-1-f, x)))(
          min(g-1, n-g/2)))(2^ilog2(n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 1)):
    seq(T(n), n=0..15);
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, 1, Function[g, Function [f,
       Expand[b[f, 1]*b[n - 1 - f, 1]*t + b[f, x]*b[n - 1 - f, x]]][
       Min[g - 1, n - g/2]]][2^(Length[IntegerDigits[n, 2]] - 1)]];
    T[n_] := CoefficientList[b[n, 1], x];
    Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, May 09 2024, after Alois P. Heinz *)

Formula

Sum_{k>=0} k * T(n,k) = A139756(n) = ceiling((n-1)*2^n/4).
Sum_{k>=0} (k+1) * T(n,k) = A045623(n) = ceiling((n+3)*2^n/4).

A168542 Number of trees that have a maximum 'n'.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 5, 10, 10, 20, 25, 50, 52, 104, 130, 260, 260, 520, 650, 1300, 1352, 2704, 3380, 6760, 6770, 13540, 16925, 33850, 35204, 70408, 88010, 176020, 176020, 352040, 440050, 880100, 915304, 1830608, 2288260, 4576520, 4583290, 9166580, 11458225
Offset: 0

Views

Author

Endi Begeja (andy.bege(AT)libero.it), Nov 29 2009

Keywords

Comments

a(2^n) = Product_{k=1..n} A003095(k). - Michael Somos, Dec 20 2018

Crossrefs

Partial differences of A091980. - Alois P. Heinz, Jul 12 2019

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, (g-> (f->
          1+b(f)*b(n-1-f))(min(g-1, n-g/2)))(2^ilog2(n)))
        end:
    a:= n-> b(n)-`if`(n=0, 0, b(n-1)):
    seq(a(n), n=0..45);  # Alois P. Heinz, Jul 12 2019
  • Mathematica
    a[ n_] := If[ n < 3, Boole[n > 0], With[{m = BitLength[Quotient[n, 3]] - 1}, Nest[#^2 + 1 &, 2, m] a[n - 2 2^m]]]; (* Michael Somos, Dec 20 2018 *)
  • PARI
    {a(n) = if( n<3, n>0, my(m = #binary(n\3)-1, t = 2); for(i=1, m, t = t^2+1); t*a(n - 2*2^m))}; /* Michael Somos, Dec 20 2018 */

Formula

a(1) = a(2) = 1, a(3*2^m + k) = A003095(m+2) * a(n - 2*2^m) where 0 <= k < 3*2^m. - Michael Somos, Dec 20 2018
a(n) = Sum_{k=0..n} (A309049(n,k)-A309049(n-1,k)) for n > 0, a(0) = 1. - Alois P. Heinz, Jul 12 2019

Extensions

a(0)=1 prepended by Alois P. Heinz, Jul 12 2019

A309052 Total number of 1's in all (binary) max-heaps on n elements from the set {0,1}.

Original entry on oeis.org

0, 1, 3, 8, 15, 31, 54, 105, 166, 298, 478, 863, 1307, 2247, 3500, 6136, 9032, 15084, 23039, 39599, 57955, 96019, 145627, 248223, 357650, 583274, 875459, 1476754, 2131618, 3476550, 5210521, 8766473, 12498445, 20138409, 29952394, 50020414, 71658602, 115850282
Offset: 0

Views

Author

Alois P. Heinz, Jul 09 2019

Keywords

Comments

Also the total number of 0's in all (binary) min-heaps on n elements from the set {0,1}.

Examples

			a(4) = 15 = 0+1+2+2+3+3+4, the total number of 1's in 0000, 1000, 1010, 1100, 1101, 1110, 1111.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, (g-> (f-> expand(
          1+x*b(f)*b(n-1-f)))(min(g-1, n-g/2)))(2^ilog2(n)))
        end:
    a:= n-> subs(x=1, diff(b(n), x)):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_][x_] := b[n][x] = If[n == 0, 1, Function[g, Function[f, Expand[1 + x b[f][x] b[n - 1 - f][x]]][Min[g - 1, n - g/2]]][2^(Length[IntegerDigits[ n, 2]] - 1)]];
    a[n_] := b[n]'[1];
    a /@ Range[0, 40] (* Jean-François Alcover, Apr 22 2021, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=0..n} (n-k) * A309049(n,k).
a(n) = n * A091980(n+1) - A309051(n).
a(2^n-1) = A024358(n).

A309051 Total number of 0's in all (binary) max-heaps on n elements from the set {0,1}.

Original entry on oeis.org

0, 1, 3, 7, 13, 24, 42, 77, 122, 206, 332, 578, 889, 1484, 2338, 4019, 5960, 9685, 14887, 25134, 37225, 60704, 92919, 156646, 227302, 364551, 550329, 917822, 1337358, 2158150, 3258779, 5441757, 7800755, 12412461, 18546566, 30708486, 44327782, 71090442
Offset: 0

Views

Author

Alois P. Heinz, Jul 09 2019

Keywords

Comments

Also the total number of 1's in all (binary) min-heaps on n elements from the set {0,1}.

Examples

			a(4) = 13 = 4+3+2+2+1+1+0, the total number of 0's in 0000, 1000, 1010, 1100, 1101, 1110, 1111.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, (g-> (f-> expand(
          x^n+b(f)*b(n-1-f)))(min(g-1, n-g/2)))(2^ilog2(n)))
        end:
    a:= n-> subs(x=1, diff(b(n), x)):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_][x_] := b[n][x] = If[n == 0, 1, Function[g, Function[f, Expand[x^n + b[f][x] b[n - 1 - f][x]]][Min[g - 1, n - g/2]]][2^(Length[IntegerDigits[ n, 2]] - 1)]];
    a[n_] := b[n]'[1];
    a /@ Range[0, 40] (* Jean-François Alcover, Apr 22 2021, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=0..n} k * A309049(n,k).
a(n) = n * A091980(n+1) - A309052(n).

A355108 Maximal number of root ancestral configurations among matching gene trees and species trees with n leaves.

Original entry on oeis.org

0, 1, 2, 4, 6, 10, 15, 25, 35, 55, 80, 130, 182, 286, 416, 676, 936, 1456, 2106, 3406, 4758, 7462, 10842, 17602, 24372, 37912, 54837, 88687, 123891, 194299, 282309, 458329, 634349, 986389, 1426439, 2306539, 3221843, 5052451, 7340711, 11917231, 16500521
Offset: 1

Views

Author

Noah A Rosenberg, Jun 19 2022

Keywords

Comments

An ancestral configuration is a set of gene lineages present immediately before a node of a species tree is reached, looking backward in time, and a root ancestral configuration is an ancestral configuration at the root node. The term a(n) gives the largest number of root ancestral configurations among pairs (G,S) where G is a labeled gene tree topology, S is a bijectively labeled species tree topology, G and S have n leaves, and G=S.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 0, (g-> (f->
         (1+a(f))*(1+a(n-f)))(min(g, n-g/2)))(2^ilog2(n)))
        end:
    seq(a(n), n=1..42);  # Alois P. Heinz, Jun 19 2022
  • Mathematica
    b[n_] := b[n] = If[n == 1, 1, 1+Max[Table[b[i] b[n-i], {i, n-1}]]];
    a[n_] := b[n]-1;
    Array[a, 42] (* Jean-François Alcover, Jun 25 2022 *)

Formula

a(n) = max_{i=1..floor(n/2)} (a(i)+1)*(a(n-i)+1), with a(1)=0.
a(n) = A091980(n) - 1.
a(2^n) = A004019(n) = A003095(n)^2.
Showing 1-10 of 14 results. Next