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

A290689 Number of transitive rooted trees with n nodes.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 88, 143, 229, 370, 592, 955, 1527, 2457, 3929, 6304, 10081
Offset: 1

Views

Author

Gus Wiseman, Oct 19 2017

Keywords

Comments

A rooted tree is transitive if every proper terminal subtree is also a branch of the root. First differs from A206139 at a(13) = 143.
Regarding the notation, a rooted tree is a finite multiset of rooted trees. For example, the rooted tree (o(o)(oo)) is short for {{},{{}},{{},{}}}. Each "o" is a leaf. Each pair of parentheses corresponds to a non-leaf node (such as the root). Its contents "(...)" represent a branch. - Gus Wiseman, Nov 16 2024

Examples

			The a(7) = 8 7-node transitive rooted trees are: (o(oooo)), (oo(ooo)), (o(o)((o))), (o(o)(oo)), (ooo(oo)), (oo(o)(o)), (oooo(o)), (oooooo).
		

Crossrefs

The restriction to identity trees (A004111) is A279861, ranks A290760.
These trees are ranked by A290822.
The anti-transitive version is A306844, ranks A324758.
The totally transitive case is A318185 (by leaves A318187), ranks A318186.
A version for integer partitions is A324753, for subsets A324736.
The ordered version is A358453, ranks A358457, undirected A358454.

Programs

  • Mathematica
    nn=18;
    rtall[n_]:=If[n===1,{{}},Module[{cas},Union[Sort/@Join@@(Tuples[rtall/@#]&/@IntegerPartitions[n-1])]]];
    Table[Length[Select[rtall[n],Complement[Union@@#,#]==={}&]],{n,nn}]

Extensions

a(20) from Robert Price, Sep 13 2018
a(21)-a(22) from Robert P. P. McKone, Dec 16 2023

A331681 One, two, and all numbers of the form 2^k * prime(j) where k > 0 and j already belongs to the sequence.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 16, 24, 26, 28, 32, 38, 48, 52, 56, 64, 74, 76, 86, 96, 104, 106, 112, 128, 148, 152, 172, 178, 192, 202, 208, 212, 214, 224, 256, 262, 296, 304, 326, 344, 356, 384, 404, 416, 424, 428, 446, 448, 478, 512, 524, 526, 592, 608, 622, 652
Offset: 1

Views

Author

Gus Wiseman, Jan 26 2020

Keywords

Comments

Also Matula-Goebel numbers of semi-lone-child-avoiding locally disjoint rooted semi-identity trees. A rooted tree is semi-lone-child-avoiding if there are no vertices with exactly one child unless the child is an endpoint/leaf. Locally disjoint means no branch of any vertex overlaps a different (unequal) branch of the same vertex. In a semi-identity tree, all non-leaf branches of any given vertex are distinct. Note that these conditions together imply that there is at most one non-leaf branch under any given vertex.
Also Matula-Goebel numbers of semi-lone-child-avoiding rooted trees with at most one non-leaf branch under any given vertex.
The Matula-Goebel number of a rooted tree is the product of primes indexed by the Matula-Goebel numbers of its branches (of the root), which gives a bijective correspondence between positive integers and unlabeled rooted trees.

Examples

			The sequence of all semi-lone-child-avoiding rooted trees with at most one non-leaf branch under any given vertex, together with their Matula-Goebel numbers, begins:
   1: o
   2: (o)
   4: (oo)
   6: (o(o))
   8: (ooo)
  12: (oo(o))
  14: (o(oo))
  16: (oooo)
  24: (ooo(o))
  26: (o(o(o)))
  28: (oo(oo))
  32: (ooooo)
  38: (o(ooo))
  48: (oooo(o))
  52: (oo(o(o)))
  56: (ooo(oo))
  64: (oooooo)
  74: (o(oo(o)))
  76: (oo(ooo))
  86: (o(o(oo)))
		

Crossrefs

The enumeration of these trees by nodes is A324969 (essentially A000045).
The enumeration of these trees by leaves appears to be A090129(n + 1).
The (non-semi) lone-child-avoiding version is A331683.
Matula-Goebel numbers of rooted semi-identity trees are A306202.
Lone-child-avoiding locally disjoint rooted trees by leaves are A316697.
The set S of numbers with at most one prime index in S is A331784.
Matula-Goebel numbers of locally disjoint rooted trees are A316495.

Programs

  • Maple
    N:= 1000: # for terms <= N
    S:= {1,2}:
    with(queue):
    Q:= new(1,2):
    while not empty(Q) do
      r:= dequeue(Q);
      p:= ithprime(r);
      newS:= {seq(2^i*p,i=1..ilog2(N/p))} minus S;
      S:= S union newS;
      for s in newS do enqueue(Q,s) od:
    od:
    sort(convert(S,list)); # Robert Israel, Feb 05 2020
  • Mathematica
    uryQ[n_]:=n==1||MatchQ[FactorInteger[n],({{2,},{p,1}}/;uryQ[PrimePi[p]])|{{2,_}}];
    Select[Range[100],uryQ]

Formula

Intersection of A306202 (semi-identity), A316495 (locally disjoint), and A331935 (semi-lone-child-avoiding). - Gus Wiseman, Jun 09 2020

A374439 Triangle read by rows: the coefficients of the Lucas-Fibonacci polynomials. T(n, k) = T(n - 1, k) + T(n - 2, k - 2) with initial values T(n, k) = k + 1 for k < 2.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 3, 4, 1, 1, 2, 4, 6, 3, 2, 1, 2, 5, 8, 6, 6, 1, 1, 2, 6, 10, 10, 12, 4, 2, 1, 2, 7, 12, 15, 20, 10, 8, 1, 1, 2, 8, 14, 21, 30, 20, 20, 5, 2, 1, 2, 9, 16, 28, 42, 35, 40, 15, 10, 1, 1, 2, 10, 18, 36, 56, 56, 70, 35, 30, 6, 2
Offset: 0

Views

Author

Peter Luschny, Jul 22 2024

Keywords

Comments

There are several versions of Lucas and Fibonacci polynomials in this database. Our naming follows the convention of calling polynomials after the values of the polynomials at x = 1. This assumes a regular sequence of polynomials, that is, a sequence of polynomials where degree(p(n)) = n. This view makes the coefficients of the polynomials (the terms of a row) a refinement of the values at the unity.
A remarkable property of the polynomials under consideration is that they are dual in this respect. This means they give the Lucas numbers at x = 1 and the Fibonacci numbers at x = -1 (except for the sign). See the example section.
The Pell numbers and the dual Pell numbers are also values of the polynomials, at the points x = -1/2 and x = 1/2 (up to the normalization factor 2^n). This suggests a harmonized terminology: To call 2^n*P(n, -1/2) = 1, 0, 1, 2, 5, ... the Pell numbers (A000129) and 2^n*P(n, 1/2) = 1, 4, 9, 22, ... the dual Pell numbers (A048654).
Based on our naming convention one could call A162515 (without the prepended 0) the Fibonacci polynomials. In the definition above only the initial values would change to: T(n, k) = k + 1 for k < 1. To extend this line of thought we introduce A374438 as the third triangle of this family.
The triangle is closely related to the qStirling2 numbers at q = -1. For the definition of these numbers see A333143. This relates the triangle to A065941 and A103631.

Examples

			Triangle starts:
  [ 0] [1]
  [ 1] [1, 2]
  [ 2] [1, 2, 1]
  [ 3] [1, 2, 2,  2]
  [ 4] [1, 2, 3,  4,  1]
  [ 5] [1, 2, 4,  6,  3,  2]
  [ 6] [1, 2, 5,  8,  6,  6,  1]
  [ 7] [1, 2, 6, 10, 10, 12,  4,  2]
  [ 8] [1, 2, 7, 12, 15, 20, 10,  8,  1]
  [ 9] [1, 2, 8, 14, 21, 30, 20, 20,  5,  2]
  [10] [1, 2, 9, 16, 28, 42, 35, 40, 15, 10, 1]
.
Table of interpolated sequences:
  |  n | A039834 & A000045 | A000032 |   A000129   |   A048654  |
  |  n |     -P(n,-1)      | P(n,1)  |2^n*P(n,-1/2)|2^n*P(n,1/2)|
  |    |     Fibonacci     |  Lucas  |     Pell    |    Pell*   |
  |  0 |        -1         |     1   |       1     |       1    |
  |  1 |         1         |     3   |       0     |       4    |
  |  2 |         0         |     4   |       1     |       9    |
  |  3 |         1         |     7   |       2     |      22    |
  |  4 |         1         |    11   |       5     |      53    |
  |  5 |         2         |    18   |      12     |     128    |
  |  6 |         3         |    29   |      29     |     309    |
  |  7 |         5         |    47   |      70     |     746    |
  |  8 |         8         |    76   |     169     |    1801    |
  |  9 |        13         |   123   |     408     |    4348    |
		

Crossrefs

Triangles related to Lucas polynomials: A034807, A114525, A122075, A061896, A352362.
Triangles related to Fibonacci polynomials: A162515, A053119, A168561, A049310, A374441.
Sums include: A000204 (Lucas numbers, row), A000045 & A212804 (even sums, Fibonacci numbers), A006355 (odd sums), A039834 (alternating sign row).
Type m^n*P(n, 1/m): A000129 & A048654 (Pell, m=2), A108300 & A003688 (m=3), A001077 & A048875 (m=4).
Adding and subtracting the values in a row of the table (plus halving the values obtained in this way): A022087, A055389, A118658, A052542, A163271, A371596, A324969, A212804, A077985, A069306, A215928.
Columns include: A040000 (k=1), A000027 (k=2), A005843 (k=3), A000217 (k=4), A002378 (k=5).
Diagonals include: A000034 (k=n), A029578 (k=n-1), abs(A131259) (k=n-2).
Cf. A029578 (subdiagonal), A124038 (row reversed triangle, signed).

Programs

  • Magma
    function T(n,k) // T = A374439
      if k lt 0 or k gt n then return 0;
      elif k le 1 then return k+1;
      else return T(n-1,k) + T(n-2,k-2);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 23 2025
    
  • Maple
    A374439 := (n, k) -> ifelse(k::odd, 2, 1)*binomial(n - irem(k, 2) - iquo(k, 2), iquo(k, 2)):
    # Alternative, using the function qStirling2 from A333143:
    T := (n, k) -> 2^irem(k, 2)*qStirling2(n, k, -1):
    seq(seq(T(n, k), k = 0..n), n = 0..10);
  • Mathematica
    A374439[n_, k_] := (# + 1)*Binomial[n - (k + #)/2, (k - #)/2] & [Mod[k, 2]];
    Table[A374439[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* Paolo Xausa, Jul 24 2024 *)
  • Python
    from functools import cache
    @cache
    def T(n: int, k: int) -> int:
        if k > n: return 0
        if k < 2: return k + 1
        return T(n - 1, k) + T(n - 2, k - 2)
    
  • Python
    from math import comb as binomial
    def T(n: int, k: int) -> int:
        o = k & 1
        return binomial(n - o - (k - o) // 2, (k - o) // 2) << o
    
  • Python
    def P(n, x):
        if n < 0: return P(n, x)
        return sum(T(n, k)*x**k for k in range(n + 1))
    def sgn(x: int) -> int: return (x > 0) - (x < 0)
    # Table of interpolated sequences
    print("|  n | A039834 & A000045 | A000032 |   A000129   |   A048654  |")
    print("|  n |     -P(n,-1)      | P(n,1)  |2^n*P(n,-1/2)|2^n*P(n,1/2)|")
    print("|    |     Fibonacci     |  Lucas  |     Pell    |    Pell*   |")
    f = "| {0:2d} | {1:9d}         |  {2:4d}   |   {3:5d}     |    {4:4d}    |"
    for n in range(10): print(f.format(n, -P(n, -1), P(n, 1), int(2**n*P(n, -1/2)), int(2**n*P(n, 1/2))))
    
  • SageMath
    from sage.combinat.q_analogues import q_stirling_number2
    def A374439(n,k): return (-1)^((k+1)//2)*2^(k%2)*q_stirling_number2(n+1, k+1, -1)
    print(flatten([[A374439(n, k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Jan 23 2025

Formula

T(n, k) = 2^k' * binomial(n - k' - (k - k') / 2, (k - k') / 2) where k' = 1 if k is odd and otherwise 0.
T(n, k) = (1 + (k mod 2))*qStirling2(n, k, -1), see A333143.
2^n*P(n, -1/2) = A000129(n - 1), Pell numbers, P(-1) = 1.
2^n*P(n, 1/2) = A048654(n), dual Pell numbers.
T(2*n, n) = (1/2)*(-1)^n*( (1+(-1)^n)*A005809(n/2) - 2*(1-(-1)^n)*A045721((n-1)/2) ). - G. C. Greubel, Jan 23 2025

A071679 Least k such that the maximum number of elements among the continued fractions for k/1, k/2, k/3, k/4, ..., k/k equals n.

Original entry on oeis.org

1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155
Offset: 1

Views

Author

Benoit Cloitre, Jun 22 2002

Keywords

Crossrefs

Programs

Formula

Smallest k such that n = Max_{ i=1..k: Card[ contfrac(k/i) ] }.
a(1) = 1; for n>1 a(n) = F(n+2) where F(n)=A000045(n) are the Fibonacci numbers.
G.f.: (1+x)^2/(1-x-x^2); a(n) = 3*F(n+1) - F(n-1) - 0^n. - Paul Barry, Jul 26 2004
a(n) = Fibonacci(n+2) for n > 1. - Charles R Greathouse IV, Jan 17 2012

A193737 Mirror of the triangle A193736.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 4, 3, 1, 3, 8, 8, 4, 1, 5, 15, 19, 13, 5, 1, 8, 28, 42, 36, 19, 6, 1, 13, 51, 89, 91, 60, 26, 7, 1, 21, 92, 182, 216, 170, 92, 34, 8, 1, 34, 164, 363, 489, 446, 288, 133, 43, 9, 1, 55, 290, 709, 1068, 1105, 826, 455, 184, 53, 10, 1, 89, 509, 1362, 2266, 2619, 2219, 1414, 682, 246, 64, 11, 1
Offset: 0

Views

Author

Clark Kimberling, Aug 04 2011

Keywords

Comments

This triangle is obtained by reversing the rows of the triangle A193736.

Examples

			First six rows:
  1;
  1,  1;
  1,  2,  1;
  2,  4,  3,  1;
  3,  8,  8,  4,  1;
  5, 15, 19, 13,  5,  1;
		

Crossrefs

Cf. A000007, A011782 (diagonal sums), A019590, A052542 (row sums).

Programs

  • Magma
    function T(n,k) // T = A193737
      if k lt 0 or n lt 0 then return 0;
      elif n lt 3 then return Binomial(n,k);
      else return T(n - 1, k) + T(n - 1, k - 1) + T(n - 2, k);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 24 2023
    
  • Mathematica
    (* First program *)
    z=20;
    p[0, x_]:= 1;
    p[n_, x_]:= Fibonacci[n+1, x] /; n > 0
    q[n_, x_]:= (x + 1)^n;
    t[n_, k_]:= Coefficient[p[n, x], x^(n-k)];
    t[n_, n_]:= p[n, x] /. x -> 0;
    w[n_, x_]:= Sum[t[n, k]*q[n-k+1, x], {k,0,n}]; w[-1, x_] := 1;
    g[n_]:= CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n,-1,z}]] (* A193736 *)
    TableForm[Table[g[n], {n,-1,z}]]
    Flatten[Table[g[n], {n,-1,z}]]          (* A193737 *)
    (* Additional programs *)
    (* Function RiordanSquare defined in A321620. *)
    RiordanSquare[1 + 1/(1 - x - x^2), 11]//Flatten  (* Peter Luschny, Feb 27 2021 *)
    T[n_, k_]:= T[n, k]= If[n<3, Binomial[n, k], T[n-1,k] + T[n-1,k-1] + T[n-2,k]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 24 2023 *)
  • SageMath
    def T(n,k): # T = A193737
        if (n<3): return binomial(n,k)
        else: return T(n-1,k) +T(n-1,k-1) +T(n-2,k)
    flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Oct 24 2023

Formula

Write w(n,k) for the triangle at A193736. This is then given by w(n,n-k).
T(0,0) = T(1,0) = T(1,1) = T(2,0) = 1; T(n,k) = 0 if k<0 or k>n; T(n,k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k). - Philippe Deléham, Feb 13 2020
From G. C. Greubel, Oct 24 2023: (Start)
T(n, 0) = Fibonacci(n) + [n=0] = A324969(n+1).
T(n, n-1) = n, for n >= 1.
T(n, n-2) = A034856(n-1), for n >= 2.
T(2*n, n) = A330793(n).
Sum_{k=0..n} T(n,k) = A052542(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A000007(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A011782(n).
Sum_{k=0..floor(n/2)} (-1)^k * T(n-k,k) = A019590(n). (End)

A324968 Matula-Goebel numbers of rooted identity trees whose non-leaf terminal subtrees are all different.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 11, 13, 22, 26, 29, 31, 41, 58, 62, 79, 82, 101, 109, 127, 158, 179, 202, 218, 254, 271, 293, 358, 401, 421, 542, 547, 586, 599, 709, 802, 842, 929, 1063, 1094, 1198, 1231, 1361, 1418, 1609, 1741, 1858, 1913, 2126, 2411, 2462, 2722, 2749
Offset: 1

Views

Author

Gus Wiseman, Mar 21 2019

Keywords

Comments

A rooted identity tree is an unlabeled rooted tree with no repeated branches directly under the same root. This sequence ranks rooted identity trees satisfying the additional condition that all non-leaf terminal subtrees are different.

Examples

			The sequence of trees together with the Matula-Goebel numbers begins:
    1: o
    2: (o)
    3: ((o))
    5: (((o)))
    6: (o(o))
   10: (o((o)))
   11: ((((o))))
   13: ((o(o)))
   22: (o(((o))))
   26: (o(o(o)))
   29: ((o((o))))
   31: (((((o)))))
   41: (((o(o))))
   58: (o(o((o))))
   62: (o((((o)))))
   79: ((o(((o)))))
   82: (o((o(o))))
  101: ((o(o(o))))
  109: (((o((o)))))
  127: ((((((o))))))
		

Crossrefs

Programs

  • Mathematica
    mgtree[n_Integer]:=If[n==1,{},mgtree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],And[And@@Cases[mgtree[#],q:{}:>UnsameQ@@q,{0,Infinity}],UnsameQ@@Cases[mgtree[#],{},{0,Infinity}]]&]

Formula

Intersection of A324935 and A276625.

A324978 Matula-Goebel numbers of rooted trees that are not identity trees but whose non-leaf terminal subtrees are all different.

Original entry on oeis.org

4, 7, 8, 12, 14, 16, 17, 19, 20, 21, 24, 28, 32, 34, 35, 37, 38, 40, 42, 43, 44, 48, 51, 52, 53, 56, 57, 59, 64, 67, 68, 70, 71, 73, 74, 76, 77, 80, 84, 85, 86, 88, 89, 91, 95, 96, 102, 104, 106, 107, 112, 114, 116, 118, 124, 128, 129, 131, 133, 134, 136, 139
Offset: 1

Views

Author

Gus Wiseman, Mar 21 2019

Keywords

Comments

An unlabeled rooted tree is an identity tree if there are no repeated branches directly under the same root.

Examples

			The sequence of trees together with the Matula-Goebel numbers begins:
   4: (oo)
   7: ((oo))
   8: (ooo)
  12: (oo(o))
  14: (o(oo))
  16: (oooo)
  17: (((oo)))
  19: ((ooo))
  20: (oo((o)))
  21: ((o)(oo))
  24: (ooo(o))
  28: (oo(oo))
  32: (ooooo)
  34: (o((oo)))
  35: (((o))(oo))
  37: ((oo(o)))
  38: (o(ooo))
  40: (ooo((o)))
  42: (o(o)(oo))
  43: ((o(oo)))
		

Crossrefs

Programs

  • Mathematica
    mgtree[n_]:=If[n==1,{},mgtree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],And[!And@@Cases[mgtree[#],q:{}:>UnsameQ@@q,{0,Infinity}],UnsameQ@@Cases[mgtree[#],{},{0,Infinity}]]&]

Formula

Complement of A276625 in A324935.

A331993 Number of semi-lone-child-avoiding rooted semi-identity trees with n unlabeled vertices.

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 11, 22, 43, 90, 185, 393, 835, 1802, 3904, 8540, 18756, 41463, 92022, 205179, 459086, 1030917, 2321949, 5245104, 11878750, 26967957, 61359917, 139902251, 319591669, 731385621, 1676573854, 3849288924, 8850674950, 20378544752, 46982414535
Offset: 1

Views

Author

Gus Wiseman, Feb 05 2020

Keywords

Comments

Semi-lone-child-avoiding means there are no vertices with exactly one child unless that child is an endpoint/leaf.
In a semi-identity tree, the non-leaf branches of any given vertex are distinct.

Examples

			The a(1) = 1 through a(7) = 11 trees:
  o  (o)  (oo)  (ooo)   (oooo)   (ooooo)    (oooooo)
                (o(o))  (o(oo))  (o(ooo))   (o(oooo))
                        (oo(o))  (oo(oo))   (oo(ooo))
                                 (ooo(o))   (ooo(oo))
                                 ((o)(oo))  (oooo(o))
                                 (o(o(o)))  ((o)(ooo))
                                            (o(o)(oo))
                                            (o(o(oo)))
                                            (o(oo(o)))
                                            (oo(o(o)))
                                            ((o)(o(o)))
		

Crossrefs

Not requiring any lone-child-avoidance gives A306200.
The locally disjoint case is A324969 (essentially A000045).
Matula-Goebel numbers of these trees are A331994.
Lone-child-avoiding rooted identity trees are A000007.
Semi-lone-child-avoiding rooted trees are A331934.
Semi-lone-child-avoiding rooted identity trees are A331964.
Lone-child-avoiding rooted semi-identity trees are A331966.

Programs

  • Mathematica
    sssb[n_]:=Switch[n,1,{{}},2,{{{}}},_,Join@@Function[c,Select[Union[Sort/@Tuples[sssb/@c]],UnsameQ@@DeleteCases[#,{}]&]]/@Rest[IntegerPartitions[n-1]]];
    Table[Length[sssb[n]],{n,10}]
  • PARI
    WeighT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v,n,(-1)^(n-1)/n))))-1,-#v)}
    seq(n)={my(v=[0]); for(n=1, n-1, v=concat(v, 1 + vecsum(WeighT(v)) - v[n])); v[1]=1; v} \\ Andrew Howroyd, Feb 09 2020

Extensions

Terms a(26) and beyond from Andrew Howroyd, Feb 09 2020

A356604 Number of integer compositions of n into odd parts covering an initial interval of odd positive integers.

Original entry on oeis.org

1, 1, 1, 1, 3, 4, 5, 9, 13, 24, 40, 61, 101, 160, 257, 415, 679, 1103, 1774, 2884, 4656, 7517, 12165, 19653, 31753, 51390, 83134, 134412, 217505, 351814, 569081, 920769, 1489587, 2409992, 3899347, 6309059, 10208628, 16518910, 26729830, 43254212, 69994082
Offset: 0

Views

Author

Gus Wiseman, Aug 30 2022

Keywords

Examples

			The a(1) = 1 through a(8) = 13 compositions:
  (1)  (11)  (111)  (13)    (113)    (1113)    (133)      (1133)
                    (31)    (131)    (1131)    (313)      (1313)
                    (1111)  (311)    (1311)    (331)      (1331)
                            (11111)  (3111)    (11113)    (3113)
                                     (111111)  (11131)    (3131)
                                               (11311)    (3311)
                                               (13111)    (111113)
                                               (31111)    (111131)
                                               (1111111)  (111311)
                                                          (113111)
                                                          (131111)
                                                          (311111)
                                                          (11111111)
The a(9) = 24 compositions:
  (135)  (11133)  (1111113)  (111111111)
  (153)  (11313)  (1111131)
  (315)  (11331)  (1111311)
  (351)  (13113)  (1113111)
  (513)  (13131)  (1131111)
  (531)  (13311)  (1311111)
         (31113)  (3111111)
         (31131)
         (31311)
         (33111)
		

Crossrefs

The case of partitions is A053251, ranked by A356232 and A356603.
These compositions are ranked by the intersection of A060142 and A333217.
This is the odd initial case of A107428.
This is the odd restriction of A107429.
This is the normal/covering case of A324969 (essentially A000045).
The non-initial version is A356605.
A000041 counts partitions, compositions A011782.
A055932 lists numbers with prime indices covering an initial interval.
A066208 lists numbers with all odd prime indices, counted by A000009.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],normQ[(#+1)/2]&]],{n,0,15}]

Extensions

More terms from Alois P. Heinz, Sep 01 2022

A193736 Triangular array: the fusion of polynomial sequences P and Q given by p(n,x) = (n+1)-st Fibonacci polynomial and q(n,x) = (x+1)^n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 4, 2, 1, 4, 8, 8, 3, 1, 5, 13, 19, 15, 5, 1, 6, 19, 36, 42, 28, 8, 1, 7, 26, 60, 91, 89, 51, 13, 1, 8, 34, 92, 170, 216, 182, 92, 21, 1, 9, 43, 133, 288, 446, 489, 363, 164, 34, 1, 10, 53, 184, 455, 826, 1105, 1068, 709, 290, 55, 1, 11, 64, 246, 682, 1414, 2219, 2619, 2266, 1362, 509, 89
Offset: 0

Views

Author

Clark Kimberling, Aug 04 2011

Keywords

Comments

See A193722 for the definition of fusion of two sequences of polynomials or triangular arrays.

Examples

			First six rows:
  1;
  1,  1;
  1,  2,  1;
  1,  3,  4,  2;
  1,  4,  8,  8,  3;
  1,  5, 13, 19, 15,  5;
		

Crossrefs

Cf. A000007, A005314 (diagonal sums), A052542 (row sums), A077962.

Programs

  • Magma
    function T(n,k) // T = A193736
      if k lt 0 or n lt 0 then return 0;
      elif n lt 3 then return Binomial(n,k);
      else return T(n-1, k) + T(n-1, k-1) + T(n-2, k-2);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 24 2023
    
  • Mathematica
    (* First program *)
    p[0, x_] := 1
    p[n_, x_] := Fibonacci[n + 1, x] /; n > 0
    q[n_, x_] := (x + 1)^n
    t[n_, k_] := Coefficient[p[n, x], x^(n - k)];
    t[n_, n_] := p[n, x] /. x -> 0;
    w[n_, x_] := Sum[t[n, k]*q[n - k + 1, x], {k, 0, n}]; w[-1, x_] := 1
    g[n_] := CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n, -1, z}]] (* A193736 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]]          (* A193737 *)
    (* Second program *)
    T[n_, k_]:= T[n, k]= If[n<3, Binomial[n, k], T[n-1,k] +T[n-1,k-1] +T[n -2,k-2]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//TableForm (* G. C. Greubel, Oct 24 2023 *)
  • SageMath
    def T(n,k): # T = A193736
        if (n<3): return binomial(n,k)
        else: return T(n-1,k) +T(n-1,k-1) +T(n-2,k-2)
    flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Oct 24 2023

Formula

T(0,0) = T(1,0) = T(1,1) = T(2,0) = T(2,2) = 1; T(n,k) = 0 if k<0 or k>n; T(n,k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k-2). - Philippe Deléham, Feb 13 2020
From G. C. Greubel, Oct 24 2023: (Start)
T(n, k) = A193737(n, n-k).
T(n, n) = Fibonacci(n) + [n=0] = A324969(n+1).
T(n, n-1) = A029907(n).
Sum_{k=0..n} T(n, k) = A052542(n).
Sum_{k=0..n} (-1)^k * T(n, k) = A000007(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A005314(n) + [n=0].
Sum_{k=0..floor(n/2)} (-1)^k * T(n-k, k) = [n=0] + A077962(n-1). (End)
Showing 1-10 of 14 results. Next