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 19 results. Next

A167865 Number of partitions of n into distinct parts greater than 1, with each part divisible by the next.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 1, 3, 3, 3, 1, 5, 1, 5, 4, 3, 1, 6, 2, 5, 4, 5, 1, 9, 1, 6, 4, 4, 4, 8, 1, 6, 6, 7, 1, 11, 1, 8, 8, 4, 1, 10, 3, 10, 5, 8, 1, 11, 4, 10, 7, 6, 1, 13, 1, 10, 11, 7, 6, 15, 1, 9, 5, 11, 1, 14, 1, 9, 12, 8, 5, 15, 1, 16, 9, 8, 1, 18, 5, 12, 7, 10, 1, 21, 7, 13, 11, 5
Offset: 0

Views

Author

Max Alekseyev, Nov 13 2009

Keywords

Comments

Number of lone-child-avoiding achiral rooted trees with n + 1 vertices, where a rooted tree is lone-child-avoiding if all terminal subtrees have at least two branches, and achiral if all branches directly under any given vertex are equal. The Matula-Goebel numbers of these trees are given by A331967. - Gus Wiseman, Feb 07 2020

Examples

			a(12) = 4: [12], [10,2], [9,3], [8,4].
a(14) = 3: [14], [12,2], [8,4,2].
a(18) = 5: [18], [16,2], [15,3], [12,6], [12,4,2].
From _Gus Wiseman_, Jul 13 2018: (Start)
The a(36) = 8 lone-child-avoiding achiral rooted trees with 37 vertices:
  (oooooooooooooooooooooooooooooooooooo)
  ((oo)(oo)(oo)(oo)(oo)(oo)(oo)(oo)(oo)(oo)(oo)(oo))
  ((ooo)(ooo)(ooo)(ooo)(ooo)(ooo)(ooo)(ooo)(ooo))
  ((ooooo)(ooooo)(ooooo)(ooooo)(ooooo)(ooooo))
  ((oooooooo)(oooooooo)(oooooooo)(oooooooo))
  (((ooo)(ooo))((ooo)(ooo))((ooo)(ooo))((ooo)(ooo)))
  ((ooooooooooo)(ooooooooooo)(ooooooooooo))
  ((ooooooooooooooooo)(ooooooooooooooooo))
(End)
		

Crossrefs

The semi-achiral version is A320268.
Matula-Goebel numbers of these trees are A331967.
The semi-lone-child-avoiding version is A331991.
Achiral rooted trees are counted by A003238.

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember;
          `if`(n=0, 1, add(a((n-d)/d), d=divisors(n) minus{1}))
        end:
    seq(a(n), n=0..200);  # Alois P. Heinz, Mar 28 2011
  • Mathematica
    a[0] = 1; a[n_] := a[n] = DivisorSum[n, a[(n-#)/#]&, #>1&]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 07 2015 *)
  • PARI
    { A167865(n) = if(n==0,return(1)); sumdiv(n,d, if(d>1, A167865((n-d)\d) ) ) }

Formula

a(0) = 1 and for n>=1, a(n) = Sum_{d|n, d>1} a((n-d)/d).
G.f. A(x) satisfies: A(x) = 1 + x^2*A(x^2) + x^3*A(x^3) + x^4*A(x^4) + ... - Ilya Gutkovskiy, May 09 2019

A300273 Sorted list of Heinz numbers of collapsible integer partitions.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 40, 41, 43, 47, 48, 49, 53, 59, 61, 63, 64, 67, 71, 73, 79, 81, 83, 84, 89, 97, 101, 103, 107, 108, 109, 112, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169
Offset: 1

Views

Author

Gus Wiseman, Mar 01 2018

Keywords

Comments

A positive integer is in this sequence iff it can be reduced to a prime number by a sequence of collapses, where a collapse is a replacement of prime(n)^k with prime(n*k) in a number's prime factorization (k > 1).

Examples

			A sequence of collapses is 84 -> 63 -> 49 -> 19 corresponding to the sequence of partitions (4211) -> (422) -> (44) -> (8). Hence 84 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    repcaps[q_]:=Union[{q},If[SquareFreeQ[q],{},Union@@repcaps/@Union[Times[q/#,Prime[Plus@@primeMS[#]]]&/@Select[Rest[Divisors[q]],!PrimeQ[#]&&PrimePowerQ[#]&]]]];
    Select[Range[200],MemberQ[repcaps[#],_?PrimeQ]&]

A298422 Number of rooted trees with n nodes in which all positive outdegrees are the same.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 5, 2, 6, 4, 9, 2, 20, 2, 26, 12, 53, 2, 120, 2, 223, 43, 454, 2, 1100, 11, 2182, 215, 4902, 2, 11446, 2, 24744, 1242, 56014, 58, 131258, 2, 293550, 7643, 676928, 2, 1582686, 2, 3627780, 49155, 8436382, 2, 19809464, 50, 46027323, 321202
Offset: 1

Views

Author

Gus Wiseman, Jan 19 2018

Keywords

Comments

Row sums of A298426.

Examples

			The a(9) = 6 trees: ((((((((o)))))))), (o(o(o(oo)))), (o((oo)(oo))), ((oo)(o(oo))), (ooo(oooo)), (oooooooo).
		

Crossrefs

Programs

  • Mathematica
    srut[n_]:=srut[n]=If[n===1,{{}},Select[Join@@Function[c,Union[Sort/@Tuples[srut/@c]]]/@Select[IntegerPartitions[n-1],Function[ptn,And@@(Divisible[#-1,Length[ptn]]&/@ptn)]],SameQ@@Length/@Cases[#,{},{0,Infinity}]&]];
    Table[srut[n]//Length,{n,20}]

Formula

a(n) = 2 <=> n in {A008864}. - Alois P. Heinz, Jan 20 2018

Extensions

a(44)-a(52) from Alois P. Heinz, Jan 20 2018

A289078 Number of orderless same-trees of weight n.

Original entry on oeis.org

1, 2, 2, 5, 2, 9, 2, 22, 6, 11, 2, 94, 2, 13, 12, 334, 2, 205, 2, 210, 14, 17, 2, 7218, 8, 19, 68, 443, 2, 1687, 2, 69109, 18, 23, 16, 167873, 2, 25, 20, 89969, 2, 7041, 2, 1548, 644, 29, 2, 36094795, 10, 3078, 24, 2604, 2, 1484102, 20, 1287306, 26, 35, 2
Offset: 1

Views

Author

Gus Wiseman, Jun 23 2017

Keywords

Comments

An orderless same-tree t is either: (case 1) a positive integer, or (case 2) a finite multiset of two or more orderless same-trees, all having the same weight. The weight of t in case 1 is the number itself, and in case 2 it is the sum of weights of the branches. For example {{{3,{1,1,1}},{2,{1,1},{1,1}}},{{{1,1,1},{1,1,1}},{{1,1},{1,1},{1,1}}}} is an orderless same-tree of weight 24 with 2 branches.

Examples

			The a(6)=9 orderless same-trees are: 6, (33), (3(111)), (222), (22(11)), (2(11)(11)), ((11)(11)(11)), ((111)(111)), (111111).
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; 1 + add(
          binomial(a(n/d)+d-1, d), d=divisors(n) minus {1})
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jul 05 2017
  • Mathematica
    a[n_]:=If[n===1,1,1+Sum[Binomial[a[n/d]+d-1,d],{d,Rest[Divisors[n]]}]];
    Array[a,100]
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 + sumdiv(n, d, binomial(v[n/d]+d-1, d))); v} \\ Andrew Howroyd, Aug 20 2018

Formula

a(n) = 1 + Sum_{d|n, d>1} binomial(a(n/d)+d-1, d).

A298426 Regular triangle where T(n,k) is number of k-ary rooted trees with n nodes.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 3, 0, 1, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 6, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 11, 4, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 23, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gus Wiseman, Jan 19 2018

Keywords

Comments

Row sums are A298422.

Examples

			Triangle begins:
1
0  1
0  1  1
0  1  0  1
0  1  1  0  1
0  1  0  0  0  1
0  1  2  1  0  0  1
0  1  0  0  0  0  0  1
0  1  3  0  1  0  0  0  1
0  1  0  2  0  0  0  0  0  1
0  1  6  0  0  1  0  0  0  0  1
0  1  0  0  0  0  0  0  0  0  0  1
0  1  11 4  2  0  1  0  0  0  0  0  1
0  1  0  0  0  0  0  0  0  0  0  0  0  1
0  1  23 0  0  0  0  1  0  0  0  0  0  0  1
0  1  0  8  0  2  0  0  0  0  0  0  0  0  0  1
		

Crossrefs

Programs

  • Mathematica
    nn=16;
    arut[n_,k_]:=If[n===1,{{}},Join@@Function[c,Union[Sort/@Tuples[arut[#,k]&/@c]]]/@Select[IntegerPartitions[n-1],Length[#]===k&]]
    Table[arut[n,k]//Length,{n,nn},{k,0,n-1}]

A291441 Matula-Goebel numbers of orderless same-trees with all leaves equal to 1.

Original entry on oeis.org

1, 4, 8, 16, 32, 49, 64, 128, 256, 343, 361, 512, 1024, 2048, 2401, 2809, 4096, 6859, 8192, 12031, 16384, 16807, 17161, 32768, 51529, 65536, 96721, 117649, 130321, 131072, 148877, 262144, 516961, 524288, 637643, 718099, 757907, 823543, 1048576, 2097152, 2248091
Offset: 1

Views

Author

Gus Wiseman, Aug 23 2017

Keywords

Comments

See A289078 for the definition of orderless same-tree.

Examples

			a(20)=12031 corresponds to the following same-tree: {{1,1,1,1},{{1,1},{1,1}}}.
		

Crossrefs

Programs

  • Mathematica
    nn=200000;
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    leafcount[n_]:=If[n===1,1,With[{m=primeMS[n]},If[Length[m]===1,leafcount[First[m]],Total[leafcount/@m]]]];
    sameQ[n_]:=Or[n===1,With[{m=primeMS[n]},And[Length[m]>1,SameQ@@leafcount/@m,And@@sameQ/@m]]];
    Select[Range[nn],sameQ]

Extensions

More terms from Jinyuan Wang, Jun 21 2020

A297791 Number of series-reduced leaf-balanced rooted trees with n nodes. Number of orderless same-trees with n nodes and all leaves equal to 1.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 5, 1, 3, 3, 4, 3, 5, 3, 6, 4, 6, 3, 12, 3, 10, 7, 9, 6, 12, 9, 13, 16, 14, 22, 22, 24, 21, 24, 28, 14, 32, 15, 42, 20, 60, 27, 84, 44, 100, 59, 113, 74, 116, 85, 110, 97, 96, 113, 106, 149, 147, 234, 235, 377, 380, 580, 576, 838
Offset: 1

Views

Author

Gus Wiseman, Jan 06 2018

Keywords

Comments

An unlabeled rooted tree is leaf-balanced if all branches from the same root have the same number of leaves. It is series-reduced if all positive out-degrees are greater than one.

Examples

			The a(13) = 5 trees: (((oo)(oo))(oooo)), ((ooooo)(ooooo)), ((ooo)(ooo)(ooo)), ((oo)(oo)(oo)(oo)), (oooooooooooo).
		

Crossrefs

Programs

  • Mathematica
    alltim[n_]:=alltim[n]=If[n===1,{{}},Join@@Function[c,Select[Union[Sort/@Tuples[alltim/@c]],And[SameQ@@(Count[#,{},{0,Infinity}]&/@#),FreeQ[#,{_}]]&]]/@IntegerPartitions[n-1]];
    Table[Length[alltim[n]],{n,20}]
  • PARI
    lista(nn) = my(k, r, t, u, w=vector(nn, i, vector(i))); w[1][1]=1; for(s=2, nn, fordiv(s, d, if(dw[i][d], [d..nn]); forvec(v=vector(s/d, i, [1, #u]), if(nn>=r=1+sum(i=1, #v, u[v[i]]), k=1; t=1; for(i=2, #v, if(v[i]==v[i-1], k++, t*=binomial(w[u[v[i-1]]][d]+k-1, k); k=1)); w[r][s]+=t*binomial(w[u[v[#v]]][d]+k-1, k)), 1)))); vector(nn, i, vecsum(w[i])); \\ Jinyuan Wang, Feb 25 2025

Extensions

a(51) onward from Robert G. Wilson v, Jan 07 2018

A301343 Regular triangle where T(n,k) is the number of planted achiral (or generalized Bethe) trees with n nodes and k leaves.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 1, 1, 1, 0, 1, 3, 2, 2, 1, 1, 0, 1, 3, 2, 2, 1, 1, 1, 0, 1, 4, 2, 4, 1, 2, 1, 1, 0, 1, 4, 3, 4, 1, 3, 1, 1, 1, 0, 1, 5, 3, 6, 2, 4, 1, 2, 1, 1, 0, 1, 5, 3, 6, 2, 4, 1, 2, 1, 1, 1, 0, 1, 6, 4, 9, 2, 7, 1, 4, 2, 2, 1, 1, 0
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Examples

			Triangle begins:
1
1  0
1  1  0
1  1  1  0
1  2  1  1  0
1  2  1  1  1  0
1  3  2  2  1  1  0
1  3  2  2  1  1  1  0
1  4  2  4  1  2  1  1  0
1  4  3  4  1  3  1  1  1  0
1  5  3  6  2  4  1  2  1  1  0
The T(9,4) = 4 planted achiral trees: (((((oooo))))), ((((oo)(oo)))), (((oo))((oo))), ((o)(o)(o)(o)).
		

Crossrefs

Row sums are A003238. A version without the zeroes or first row is A214575.

Programs

  • Mathematica
    tri[n_,k_]:=If[k===1,1,If[k>=n,0,Sum[tri[n-k,d],{d,Divisors[k]}]]];
    Table[tri[n,k],{n,10},{k,n}]

Formula

T(n,1) = 1, T(n,k) = 0 if n <= k, otherwise T(n,k) = Sum_{d|k} T(n - k, d).

A298533 Number of unlabeled rooted trees with n vertices such that every branch of the root has the same number of leaves.

Original entry on oeis.org

1, 1, 2, 4, 8, 15, 31, 64, 144, 333, 808, 2004, 5109, 13199, 34601, 91539, 244307, 656346, 1774212, 4820356, 13157591, 36060811, 99198470, 273790194, 757971757, 2104222594, 5856496542, 16338140048, 45678276507, 127964625782, 359155302204, 1009790944307
Offset: 1

Views

Author

Gus Wiseman, Jan 20 2018

Keywords

Examples

			The a(5) = 8 trees: ((((o)))), (((oo))), ((o(o))), ((ooo)), (o((o))), ((o)(o)), (oo(o)), (oooo)
		

Crossrefs

Programs

  • Mathematica
    rut[n_]:=rut[n]=If[n===1,{{}},Join@@Function[c,Union[Sort/@Tuples[rut/@c]]]/@IntegerPartitions[n-1]];
    Table[Length[Select[rut[n],SameQ@@(Count[#,{},{0,Infinity}]&/@#)&]],{n,15}]
  • PARI
    \\ here R is A055277 as vector of polynomials
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    R(n) = {my(A = O(x)); for(j=1, n, A = x*(y - 1  + exp( sum(i=1, j, 1/i * subst( subst( A + x * O(x^(j\i)), x, x^i), y, y^i) ) ))); Vec(A)};
    seq(n)={my(M=Mat(apply(p->Colrev(p,n), R(n-1)))); concat([1],sum(i=2, #M, EulerT(M[i,])))} \\ Andrew Howroyd, May 20 2018

Extensions

Terms a(19) and beyond from Andrew Howroyd, May 20 2018

A300647 Number of same-trees of weight n in which all outdegrees are odd.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 10, 2, 2, 2, 2, 2, 42, 1, 2, 10, 2, 2, 138, 2, 2, 2, 34, 2, 1514, 2, 2, 42, 2, 1, 2058, 2, 162, 10, 2, 2, 8202, 2, 2, 138, 2, 2, 207370, 2, 2, 2, 130, 34, 131082, 2, 2, 1514, 2082, 2, 524298, 2, 2, 42, 2, 2, 14725738, 1, 8226, 2058, 2
Offset: 1

Views

Author

Gus Wiseman, Mar 10 2018

Keywords

Comments

A same-tree of weight n > 0 is either a single node of weight n, or a finite sequence of two or more same-trees whose weights are all equal and sum to n.

Examples

			The a(9) = 10 odd same-trees:
9,
(333),
(33(111)), (3(111)3), ((111)33)
(3(111)(111)), ((111)3(111)), ((111)(111)3),
((111)(111)(111)), (111111111).
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=1+Sum[a[n/d]^d,{d,Select[Rest[Divisors[n]],OddQ]}];
    Array[a,80]
  • PARI
    a(n) = if (n==1, 1, 1+sumdiv(n, d, if ((d > 1) && (d % 2), a(n/d)^d))); \\ Michel Marcus, Mar 10 2018

Formula

a(n) = 1 + Sum_d a(n/d)^d where the sum is over odd divisors of n greater than 1.
Showing 1-10 of 19 results. Next