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.

Previous Showing 11-20 of 44 results. Next

A316624 Number of balanced p-trees with n leaves.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 4, 8, 9, 16, 20, 40, 47, 83, 111, 201, 259, 454, 603, 1049, 1432, 2407, 3390, 6006, 8222, 13904, 20304, 34828, 50291, 85817, 126013, 217653, 317894, 535103, 798184, 1367585, 2008125, 3360067, 5048274, 8499942, 12623978, 21023718, 31552560, 52575257
Offset: 1

Views

Author

Gus Wiseman, Oct 07 2018

Keywords

Comments

A p-tree of weight n is either a single node (if n = 1) or a finite sequence of p-trees whose weights are weakly decreasing and sum to n.
A tree is balanced if all leaves have the same height.

Examples

			The a(1) = 1 through a(7) = 4 balanced p-trees:
  o  (oo)  (ooo)  (oooo)      (ooooo)      (oooooo)        (ooooooo)
                  ((oo)(oo))  ((ooo)(oo))  ((ooo)(ooo))    ((oooo)(ooo))
                                           ((oooo)(oo))    ((ooooo)(oo))
                                           ((oo)(oo)(oo))  ((ooo)(oo)(oo))
		

Crossrefs

Programs

  • Mathematica
    ptrs[n_]:=If[n==1,{"o"},Join@@Table[Tuples[ptrs/@p],{p,Rest[IntegerPartitions[n]]}]];
    Table[Length[ptrs[n]],{n,12}]
    Table[Length[Select[ptrs[n],SameQ@@Length/@Position[#,"o"]&]],{n,12}]
  • PARI
    seq(n)={my(p=x + O(x*x^n), q=0); while(p, q+=p; p = 1/prod(k=1, n, 1 - polcoef(p,k)*x^k + O(x*x^n)) - 1 - p); Vec(q)} \\ Andrew Howroyd, Oct 26 2018

Extensions

Terms a(17) and beyond from Andrew Howroyd, Oct 26 2018

A067399 Number of divisors of n in OR-numbral arithmetic.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 4, 2, 4, 2, 6, 2, 6, 5, 5, 2, 4, 2, 6, 3, 4, 2, 8, 2, 4, 4, 9, 2, 10, 8, 6, 2, 4, 2, 6, 2, 4, 2, 8, 2, 6, 2, 6, 4, 4, 4, 10, 2, 4, 4, 6, 2, 8, 4, 12, 2, 4, 4, 15, 4, 16, 14, 7, 2, 4, 2, 6, 2, 4, 2, 8, 3, 4, 2, 6, 2, 4, 2, 10, 2, 4, 2, 9, 5, 4, 2, 8, 2, 8, 4, 6, 2, 8, 6, 12, 2, 4, 4, 6
Offset: 1

Views

Author

Jens Voß, Jan 23 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic. The example shows that this sequence is not multiplicative.
In other words, number of lunar divisors of n in base 2.

Examples

			a(15)=5 since [15] has the 5 OR-numbral divisors [1], [3], [5], [7] and [15].
If written as a triangle with rows of lengths 1,2,4,8,16,...:
1,
2, 2,
3, 2, 4, 3,
4, 2, 4, 2, 6, 2, 6, 5,
5, 2, 4, 2, 6, 3, 4, 2, 8, 2, 4, 4, 9, 2, 10, 8,
6, 2, 4, 2, 6, 2, 4, 2, 8, 2, 6, 2, 6, 4, 4, 4, 10, 2, 4, 4, 6, 2, 8, 4, 12, 2, 4, 4, 15, 4, 16, 14,
...,
the last terms in each row give A079500(n). The penultimate terms in the rows give 2*A079500(n-1). - _N. J. A. Sloane_, Mar 05 2011
		

Crossrefs

A079500 is the subsequence a(2^k-1). - N. J. A. Sloane, Feb 23 2011
See A188548 for the sum of the divisors.

A306201 Number of unlabeled balanced rooted semi-identity trees with n nodes.

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 6, 8, 12, 16, 25, 35, 53, 77, 117, 173, 265, 396, 605, 919, 1408, 2147, 3305, 5070, 7819, 12049, 18635, 28811, 44672, 69264, 107618, 167292, 260446, 405686, 632743, 987441, 1542555, 2411208, 3772247, 5905002, 9250436, 14499234, 22740910, 35686092
Offset: 0

Views

Author

Gus Wiseman, Jan 29 2019

Keywords

Comments

A rooted tree is a semi-identity tree if the non-leaf branches of the root are all distinct and are themselves semi-identity trees. It is balanced if all leaves are the same distance from the root. The only balanced identity trees are rooted paths.

Examples

			The a(1) = 1 through a(7) = 8 balanced rooted semi-identity trees:
  o  (o)  (oo)   (ooo)    (oooo)     (ooooo)      (oooooo)
          ((o))  ((oo))   ((ooo))    ((oooo))     ((ooooo))
                 (((o)))  (((oo)))   (((ooo)))    (((oooo)))
                          ((((o))))  ((o)(oo))    ((o)(ooo))
                                     ((((oo))))   ((((ooo))))
                                     (((((o)))))  (((o)(oo)))
                                                  (((((oo)))))
                                                  ((((((o))))))
		

Crossrefs

Programs

  • Mathematica
    ursit[n_]:=Join@@Table[Select[Union[Sort/@Tuples[ursit/@ptn]],UnsameQ@@DeleteCases[#,{}]&],{ptn,IntegerPartitions[n-1]}];
    Table[Length[Select[ursit[n],SameQ@@Length/@Position[#,{}]&]],{n,10}]

Extensions

More terms from Alois P. Heinz, Jan 29 2019

A067398 Squares in OR-numbral arithmetic.

Original entry on oeis.org

0, 1, 4, 7, 16, 21, 28, 31, 64, 73, 84, 95, 112, 125, 124, 127, 256, 273, 292, 311, 336, 341, 380, 383, 448, 473, 500, 511, 496, 509, 508, 511, 1024, 1057, 1092, 1127, 1168, 1205, 1244, 1279, 1344, 1385, 1364, 1407, 1520, 1533, 1532, 1535, 1792, 1841, 1892
Offset: 0

Views

Author

Jens Voß, Jan 23 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic.
Or, squares in lunar arithmetic base 2, written in base 10. - N. J. A. Sloane, Oct 02 2010
This sequence is not multiplicative; for example a(15) = 127 != 7 * 21 = a(3) * a(5). It is totally OR-numbral multiplicative: a([n] * [m]) = [a(n)] * [a(m)] in OR-numbral arithmetic. - Franklin T. Adams-Watters, Oct 27 2006

Examples

			A067398(5) = 21 since [5] * [5] = [21] in OR-numbral arithmetic.
		

Crossrefs

Programs

  • Haskell
    a067398 :: Integer -> Integer
    a067398 0 = 0
    a067398 n = orm n n where
       orm 1 v = v
       orm u v = orm (shiftR u 1) (shiftL v 1) .|. if odd u then v else 0
    -- Reinhard Zumkeller, Mar 01 2013

A320169 Number of balanced enriched p-trees of weight n.

Original entry on oeis.org

1, 2, 3, 6, 9, 20, 31, 70, 114, 243, 415, 961, 1603, 3564, 6559, 14913, 26630, 60037, 110160, 248859, 458445, 1001190, 1882350, 4220358, 7765303, 16822107, 32307240, 70081784, 133716083, 291788153, 561823990, 1230204229, 2396185727, 5176454708, 10220127290
Offset: 1

Views

Author

Gus Wiseman, Oct 07 2018

Keywords

Comments

An enriched p-tree of weight n is either the number n itself or a finite sequence of enriched p-trees whose weights are weakly decreasing and sum to n.
A tree is balanced if all leaves have the same height.

Examples

			The a(1) = 1 through a(6) = 20 balanced enriched p-trees:
  1  2     3      4           5            6
     (11)  (21)   (22)        (32)         (33)
           (111)  (31)        (41)         (42)
                  (211)       (221)        (51)
                  (1111)      (311)        (222)
                  ((11)(11))  (2111)       (321)
                              (11111)      (411)
                              ((21)(11))   (2211)
                              ((111)(11))  (3111)
                                           (21111)
                                           (111111)
                                           ((21)(21))
                                           ((22)(11))
                                           ((31)(11))
                                           ((111)(21))
                                           ((21)(111))
                                           ((211)(11))
                                           ((111)(111))
                                           ((1111)(11))
                                           ((11)(11)(11))
		

Crossrefs

Programs

  • Mathematica
    eptrs[n_]:=Prepend[Join@@Table[Tuples[eptrs/@p],{p,Rest[IntegerPartitions[n]]}],n];
    Table[Length[Select[eptrs[n],SameQ@@Length/@Position[#,_Integer]&]],{n,12}]
  • PARI
    seq(n)={my(p=x/(1-x) + O(x*x^n), q=0); while(p, q+=p; p = 1/prod(k=1, n, 1 - polcoef(p,k)*x^k + O(x*x^n)) - 1 - p); Vec(q)} \\ Andrew Howroyd, Oct 26 2018

Extensions

Terms a(16) and beyond from Andrew Howroyd, Oct 26 2018

A320179 Regular triangle where T(n,k) is the number of unlabeled series-reduced rooted trees with n leaves in which every leaf is at height k.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 6, 1, 0, 0, 0, 0, 0, 1, 7, 1, 0, 0, 0, 0, 0, 0, 1, 11, 4, 0, 0, 0, 0, 0, 0, 0, 1, 13, 6, 0, 0, 0, 0, 0, 0, 0, 0, 1, 20, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 23, 23, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Oct 07 2018

Keywords

Examples

			Triangle begins:
  1
  0  1
  0  1  0
  0  1  1  0
  0  1  1  0  0
  0  1  3  0  0  0
  0  1  3  0  0  0  0
  0  1  6  1  0  0  0  0
  0  1  7  1  0  0  0  0  0
  0  1 11  4  0  0  0  0  0  0
  0  1 13  6  0  0  0  0  0  0  0
  0  1 20 16  0  0  0  0  0  0  0  0
  0  1 23 23  0  0  0  0  0  0  0  0  0
  0  1 33 46  0  0  0  0  0  0  0  0  0  0
The T(10,3) = 4 rooted trees:
   (((oo)(oo))((oo)(oooo)))
   (((oo)(oo))((ooo)(ooo)))
   (((oo)(ooo))((oo)(ooo)))
  (((oo)(oo))((oo)(oo)(oo)))
		

Crossrefs

Row sums are A120803. Third column is A083751. An irregular version is A320221.

Programs

  • Mathematica
    qurt[n_]:=If[n==1,{{}},Join@@Table[Union[Sort/@Tuples[qurt/@ptn]],{ptn,Select[IntegerPartitions[n],Length[#]>1&]}]];
    Table[Length[Select[qurt[n],SameQ[##,k]&@@Length/@Position[#,{}]&]],{n,14},{k,0,n-1}]
  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v, n, 1/n))))-1, -#v)}
    T(n)={my(u=vector(n), v=vector(n), h=1); u[1]=1; while(u, v+=u*h; h*=x; u=EulerT(u)-u); vector(n, n, Vecrev(v[n], n))}
    { my(A=T(15)); for(n=1, #A, print(A[n])) } \\ Andrew Howroyd, Dec 09 2020

A156041 Array A(n,k) (n>=1, k>=1) read by antidiagonals, where A(n,k) is the number of compositions (ordered partitions) of n into exactly k parts, some of which may be zero, with the first part greater than or equal to all the rest.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 3, 4, 4, 1, 1, 3, 6, 7, 5, 1, 1, 4, 8, 11, 11, 6, 1, 1, 4, 11, 17, 19, 16, 7, 1, 1, 5, 13, 26, 32, 31, 22, 8, 1, 1, 5, 17, 35, 54, 56, 48, 29, 9, 1, 1, 6, 20, 48, 82, 102, 93, 71, 37, 10, 1, 1, 6, 24, 63, 120, 172, 180, 148, 101, 46, 11, 1, 1, 7, 28, 81, 170
Offset: 1

Views

Author

Jack W Grahl, Feb 02 2009, Feb 11 2009

Keywords

Comments

A(n,k) is of course smaller than the number of ordered partitions of n into k parts and at least the number of partitions into k parts in descending order.
The sums of the antidiagonals give A079500 - 1. - N. J. A. Sloane, Feb 26 2011
For an alternative definition of essentially the same sequence, as a triangle, and which avoids the use of parts of size zero, see A184957. - N. J. A. Sloane, Feb 27 2011

Examples

			The array A(n,k) begins:
  1  1  1  1  1  1  1  1  1 ...
  1  2  3  4  5  6  7  8  9 ...
  1  2  4  7 11 16 22 29 ...
  1  3  6 11 19 31 48 ...
  1  3  8 17 32 56 ...
  1  4 11 26 54 ...
  1  4 13 35 ...
  ...
The antidiagonals are:
  1,
  1, 1,
  1, 2, 1,
  1, 2, 3, 1,
  1, 3, 4, 4, 1,
  1, 3, 6, 7, 5, 1,
  1, 4, 8, 11, 11, 6, 1,
  1, 4, 11, 17, 19, 16, 7, 1,
  1, 5, 13, 26, 32, 31, 22, 8, 1,
  ...
A(3,5) = 11 and the 11 partition of 3 into 5 parts of this type are: (3,0,0,0,0), (2,1,0,0,0), (2,0,1,0,0), (2,0,0,1,0), (2,0,0,0,1), (1,1,1,0,0), (1,1,0,1,0), (1,1,0,0,1), (1,0,1,1,0), (1,0,1,0,1), (1,0,0,1,1).
		

Crossrefs

A156039 gives A(n,4) and A156040 gives A(n,3). A156042 is the part on or below the main diagonal. A(n,2) is A008619. A(2,n) is A000027. A(3,n) is A000124.
Cf. A079500.

Programs

  • Maple
    b:= proc(n, i, m) option remember;
          if n<0 then 0
        elif n=0 then 1
        elif i=1 then `if`(n<=m, 1, 0)
        else add(b(n-k, i-1, m), k=0..m)
          fi
        end:
    A:= (n, k)-> add(b(n-m, k-1, m), m=ceil(n/k)..n):
    seq(seq(A(d-k, k), k=1..d-1), d=1..14); # Alois P. Heinz, Jun 14 2009
  • Mathematica
    (* Returns rectangular array *) nn=10;Table[Table[Coefficient[Series[Sum[x^i((1-x^(i+1))/(1-x))^(k-1),{i,0,n}],{x,0,nn}],x^n],{k,1,nn}],{n,1,nn}]//Grid (* Geoffrey Critzer, Jul 15 2013 *)

Formula

A(n,k) = [x^n] Sum_{i=0..n} x^i*((1 - x^(i+1))/(1-x))^(k-1). - Geoffrey Critzer, Jul 15 2013

Extensions

More terms from Alois P. Heinz, Jun 14 2009
Edited by N. J. A. Sloane, Feb 26 2011

A320155 Number of series-reduced balanced rooted trees with n labeled leaves.

Original entry on oeis.org

1, 1, 1, 4, 11, 41, 162, 1030, 7205, 55522, 442443, 3810852, 35272030, 351697516, 3735838550, 42719792640, 529195988635, 7128835815387, 103651381499810, 1610812109555323, 26489497655582729, 457497408108551450, 8248899117402701046, 154624472715479106919
Offset: 1

Views

Author

Gus Wiseman, Oct 06 2018

Keywords

Comments

A rooted tree is series-reduced if every non-leaf node has at least two branches, and balanced if all leaves are the same distance from the root.

Examples

			The a(1) = 1 through a(5) = 11 rooted trees:
  1  (12)  (123)    (1234)      (12345)
                  ((12)(34))  ((12)(345))
                  ((13)(24))  ((13)(245))
                  ((14)(23))  ((14)(235))
                              ((15)(234))
                              ((23)(145))
                              ((24)(135))
                              ((25)(134))
                              ((34)(125))
                              ((35)(124))
                              ((45)(123))
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    phy2[labs_]:=If[Length[labs]==1,labs,Union@@Table[Sort/@Tuples[phy2/@ptn],{ptn,Select[sps[Sort[labs]],Length[#1]>1&]}]];
    Table[Length[Select[phy2[Range[n]],SameQ@@Length/@Position[#,_Integer]&]],{n,7}]
  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    b(n,k)={my(u=vector(n), v=vector(n)); u[1]=k; while(u, v+=u; u=EulerT(u)-u); v}
    seq(n)={my(M=Mat(vectorv(n,k,b(n,k)))); vector(n, k, sum(i=1, k, binomial(k,i)*(-1)^(k-i)*M[i,k]))} \\ Andrew Howroyd, Oct 26 2018

Formula

E.g.f. A(x) satisfies A(x) = x + A(exp(x)-x-1). - Ira M. Gessel, Nov 17 2021

Extensions

Terms a(10) and beyond from Andrew Howroyd, Oct 26 2018

A320173 Number of inequivalent colorings of series-reduced balanced rooted trees with n leaves.

Original entry on oeis.org

1, 2, 3, 12, 23, 84, 204, 830, 2940, 13397, 58794, 283132, 1377302, 7087164, 37654377, 209943842, 1226495407, 7579549767, 49541194089, 341964495985, 2476907459261, 18703210872343, 146284738788714, 1179199861398539, 9760466433602510, 82758834102114911, 717807201648148643
Offset: 1

Views

Author

Gus Wiseman, Oct 07 2018

Keywords

Comments

A rooted tree is series-reduced if every non-leaf node has at least two branches, and balanced if all leaves are the same distance from the root.

Examples

			Inequivalent representatives of the a(1) = 1 through a(5) = 23 colorings:
  1  (11)  (111)    (1111)      (11111)
     (12)  (112)    (1112)      (11112)
           (123)    (1122)      (11122)
                    (1123)      (11123)
                    (1234)      (11223)
                  ((11)(11))    (11234)
                  ((11)(12))    (12345)
                  ((11)(22))  ((11)(111))
                  ((11)(23))  ((11)(112))
                  ((12)(12))  ((11)(122))
                  ((12)(13))  ((11)(123))
                  ((12)(34))  ((11)(223))
                              ((11)(234))
                              ((12)(111))
                              ((12)(112))
                              ((12)(113))
                              ((12)(123))
                              ((12)(134))
                              ((12)(345))
                              ((13)(122))
                              ((22)(111))
                              ((23)(111))
                              ((23)(114))
		

Crossrefs

Programs

  • PARI
    \\ See links in A339645 for combinatorial species functions.
    cycleIndexSeries(n)={my(p=x*sv(1) + O(x*x^n), q=0); while(p, q+=p; p=sEulerT(p)-1-p); q}
    InequivalentColoringsSeq(cycleIndexSeries(15)) \\ Andrew Howroyd, Dec 11 2020

Extensions

Terms a(8) and beyond from Andrew Howroyd, Dec 11 2020

A368279 a(n) is the number of compositions of n where the first part is the largest part and the last part is not 1. Row sums of A368579.

Original entry on oeis.org

1, 0, 1, 1, 2, 3, 6, 10, 19, 34, 63, 116, 216, 402, 754, 1417, 2674, 5061, 9608, 18286, 34888, 66706, 127798, 245284, 471561, 907964, 1750695, 3379992, 6533458, 12643162, 24491796, 47490688, 92170704, 179040096, 348064190, 677174709, 1318429534, 2568691317
Offset: 0

Views

Author

Peter Luschny, Jan 04 2024

Keywords

Comments

Considering more generally the family of generating functions (1 - x)^n * Sum_{j>=0} (x^j / (1 - Sum_{k=1..j} x^k)) one finds several sequences related to compositions as indicated in the cross-references.
The compositions considered here can also be understood as perfectly balanced, ordered trees. See the linked illustrations. - Peter Luschny, Feb 26 2024

Examples

			a(0) = card({[0]}) = 1.
a(1) = card({}) = 0.
a(2) = card({[2]}) = 1.
a(3) = card({[3]}) = 1.
a(4) = card({[2, 2], [4]}) = 2.
a(5) = card({[2, 1, 2], [3, 2], [5]}) = 3.
a(6) = card({[2, 2, 2], [2, 1, 1, 2], [3, 3], [3, 1, 2], [4, 2], [6]}) = 6.
a(7) = card({[2, 2, 1, 2], [2, 1, 2, 2], [2, 1, 1, 1, 2], [3, 2, 2], [3, 1, 3], [3, 1, 1, 2], [4, 3], [4, 1, 2], [5, 2], [7]}) = 10.
a(8) = card({[2, 2, 2, 2],  [2, 2, 1, 1, 2], [2, 1, 2, 1, 2], [2, 1, 1, 2, 2], [2, 1, 1, 1, 1, 2], [3, 3, 2], [3, 2, 3], [3, 2, 1, 2], [3, 1, 2, 2], [3, 1, 1, 3], [3, 1, 1, 1, 2], [4, 4], [4, 2, 2], [4, 1, 3], [4, 1, 1, 2], [5, 3], [5, 1, 2], [6, 2], [8]}) = 19.
		

Crossrefs

Cf. A369115 (n=-2), A186537 left shifted (n=-1), A079500 (n=0), this sequence (n=1), A369116 (n=2).

Programs

  • Maple
    gf := (1 - x)*sum(x^j / (1 - sum(x^k, k = 1..j)), j = 0..42):
    ser := series(gf, x, 40): seq(coeff(ser, x, n), n = 0..37);
    # Peter Luschny, Jan 19 2024
  • Python
    from functools import cache
    @cache
    def F(k, n):
        return sum(F(k,n-j) for j in range(1,min(k,n))) if n>1 else n
    def a(n): return sum(F(k+1, n+1-k) - F(k+1, n-k) for k in range(n+1))
    print([a(n) for n in range(38)])
    
  • SageMath
    def C(n): return sum(Compositions(n, max_part=k, inner=[k]).cardinality()
                     for k in (0..n))
    def a(n): return C(n) - C(n-1) if n > 1 else 1 - n
    print([a(n) for n in (0..28)])

Formula

a(n) = Sum_{k=0..n} (F(k+1, n+1-k) - F(k+1, n-k)) where F(k, n) = Sum_{j=1..min(k, n)} F(k, n-j) if n > 1 and otherwise n. F(k, n) refers to the generalized Fibonacci number A092921.
a(n) = A007059(n+1) - A007059(n).
G.f.: (1 - x)*(Sum_{j>=0} (x^j / (1 - Sum_{k=1..j} x^k ))) = (1 - x) * GfA079500. - Peter Luschny, Jan 20 2024
Previous Showing 11-20 of 44 results. Next