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.

User: David Bevan

David Bevan's wiki page.

David Bevan has authored 38 sequences. Here are the ten most recent ones:

A386674 Indices of ascending runs in a random sequence in order of decreasing expected length.

Original entry on oeis.org

5, 4, 6, 10, 11, 15, 16, 17, 21, 22, 20, 26, 27, 31, 32, 33, 37, 38, 36, 42, 43, 47, 48, 49, 53, 52, 54, 58, 59, 63, 64, 65, 69, 68, 70, 74, 75, 79, 80, 81, 85, 84, 86, 90, 91, 95, 96, 97, 101, 100, 102, 106, 107, 111, 112, 113, 117, 116, 118, 122, 123, 127
Offset: 1

Author

David Bevan, Jul 28 2025

Keywords

Comments

Let L(k) be the expected length of the k-th (maximal) ascending run in a sequence of numbers drawn uniformly and independently from [0,1]. If the set {L(k) : k>=1} is sorted in decreasing order, then a(n) is the index k of the n-th entry in the list.
The set {a(n):n>=1} consists of those k for which L(k) > 2.
L(k) is periodic with period approximately 5.332398 (see the formula below). Since this is close to 16/3, the sequence a(n), n>=1, exhibits long stretches of periodicity; e.g. a(n)-2*n has period 8 for 29<=n<=288.

Examples

			max{L(k) : k>=1} = L(5) = e^5 - 5*e^4 + 15/2*e^3 - 10/3*e^2 +5/24*e, so the fifth run (surprisingly) has longest expected length and a(1) = 5.
		

References

  • Donald E. Knuth. The Art of Computer Programming. Vol. 3: Sorting and Searching. Addison-Wesley, second edition, 1998, pages 39-42,45,603.

Crossrefs

The natural numbers are partitioned between this sequence and A386673.

Programs

  • Mathematica
    eLen[1]=N[E-1];eLen[k_]:=N[k Sum[(-1)^j(k-j)^(j-1)/j!E^(k-j),{j,0,k-1}],k+10];decList[n_]:=First/@Take[Reverse@SortBy[Table[{k,eLen[k]},{k,2n+8}],Last],n];decList@20

Formula

If k>=2, then the expected length of the k-th ascending run is L(k) = k * Sum_{j=0..k-1} (-1)^j*(k-j)^(j-1)*exp(k-j)/j!. The expected length of the first run is L(1) = e-1.
The o.g.f. for L(k) is z*(1-z)/(exp(z-1)-z)-z.
Limit_{k->oo} L(k) = 2.
If z ~ 3.088843 + 7.461489i satisfies z=exp(z-1), then asymptotically L(k)-2 ~ 2*r^-k*cos(k*t), where r = |z| ~ 8.075566, and t = arg(z) ~ 1.178304 ~ Pi/2.666199.

A386673 Indices of ascending runs in a random sequence in order of increasing expected length.

Original entry on oeis.org

1, 2, 3, 7, 8, 9, 13, 14, 12, 18, 19, 23, 24, 25, 29, 30, 28, 34, 35, 39, 40, 41, 45, 46, 44, 50, 51, 55, 56, 57, 61, 60, 62, 66, 67, 71, 72, 73, 77, 76, 78, 82, 83, 87, 88, 89, 93, 92, 94, 98, 99, 103, 104, 105, 109, 108, 110, 114, 115, 119, 120, 121, 125
Offset: 1

Author

David Bevan, Jul 28 2025

Keywords

Comments

Let L(k) be the expected length of the k-th (maximal) ascending run in a sequence of numbers drawn uniformly and independently from [0,1]. If the set {L(k) : k>=1} is sorted in increasing order, then a(n) is the index k of the n-th entry in the list.
The set {a(n):n>=1} consists of those k for which L(k) < 2.
L(k) is periodic with period approximately 5.332398 (see the formula below). Since this is close to 16/3, the sequence a(n), n>=1, exhibits long stretches of periodicity; e.g. a(n)-2*n has period 8 for 26<=n<=294.

Examples

			min{L(k) : k>=1} = L(1) = e-1, so the first run has shortest expected length and a(1) = 1.
The second and third runs have second and third shortest expected length, so a(2) = 2 and a(3) = 3.
The fourth smallest value in the set {L(k) : k>=1} is L(7), so the seventh run has fourth shortest expected length and a(4) = 7.
		

References

  • Donald E. Knuth. The Art of Computer Programming. Vol. 3: Sorting and Searching. Addison-Wesley, second edition, 1998, pages 39-42,45,603.

Crossrefs

The natural numbers are partitioned between this sequence and A386674.

Programs

  • Mathematica
    eLen[1]=N[E-1];eLen[k_]:=N[k Sum[(-1)^j(k-j)^(j-1)/j!E^(k-j),{j,0,k-1}],k+10];incList[n_]:=First/@Take[SortBy[Table[{k,eLen[k]},{k,2n+8}],Last],n];incList@20

Formula

If k>=2, then the expected length of the k-th ascending run is L(k) = k * Sum_{j=0..k-1} (-1)^j*(k-j)^(j-1)*exp(k-j)/j!. The expected length of the first run is L(1) = e-1.
The o.g.f. for L(k) is z*(1-z)/(exp(z-1)-z)-z.
Limit_{k->oo} L(k) = 2.
If z ~ 3.088843 + 7.461489i satisfies z=exp(z-1), then asymptotically L(k)-2 ~ 2*r^-k*cos(k*t), where r = |z| ~ 8.075566, and t = arg(z) ~ 1.178304 ~ Pi/2.666199.

A367494 Number of (2+2)-free naturally labeled posets on [n].

Original entry on oeis.org

1, 1, 2, 7, 37, 272, 2637, 32469, 493602, 9062503, 197409097, 5027822588, 147896295785, 4972353491993, 189357434418082, 8104194176872583, 387121098095180237, 20513320778472547576, 1199236185075846230469, 76970026071431034905229, 5399593095642890354948802
Offset: 0

Author

David Bevan, Nov 20 2023

Keywords

Comments

A partial order R is naturally labeled if xRy => x
A partial order is (2+2)-free if it does not contain an induced subposet that is isomorphic to the union of two disjoint 2-element chains.

Examples

			a(3) = A006455(3) = 7: {}, {1R2}, {1R3}, {2R3}, {1R2, 1R3}, {1R3, 2R3}, {1R2, 1R3, 2R3}.
a(4) = A006455(4) - 3 = 37: {1R2, 3R4}, {1R3, 2R4} and {1R4, 2R3} (trivially) contain a 2+2 subposet.
		

Crossrefs

Cf. A006455 (naturally labeled posets), A113226 ({3,2+2}-free naturally labeled posets).

A356111 The number of 1+1+1-free ordered posets of [n].

Original entry on oeis.org

1, 1, 2, 6, 23, 102, 497, 2586, 14127, 80146, 468688, 2810163, 17206549, 107261051, 679096359, 4358360362, 28309516828, 185862601727, 1232042778231, 8238155634738, 55521191613041, 376888928783870, 2575334987109807, 17704834935517727, 122401523831513816
Offset: 0

Author

David Bevan, Jul 27 2022

Keywords

Comments

A partial order R on [n] is ordered if xRy implies x < y; i.e., the natural order (<) is a linear extension of R. 1+1+1-free posets are those with width (longest antichain) at most 2.

Examples

			The six 1+1+1-free ordered posets of [3] are those with covering relations {(1,2)}, {(1,3)}, {(2,3)}, {(1,2), (1,3)}, {(1,2), (2,3)} and {(1,3), (2,3)}.
		

Crossrefs

See A006455 for the number of all ordered posets on [n], and A135922 for the number of ordered posets on [n] with height at most two.
Cf. A001181.

Formula

Conjectured g.f.: 2 - 2*x/(B(x)-1+x), where B(x) is the o.g.f. for A001181. - Michael D. Weiner, Oct 04 2024

A332345 a(n) is the number of totally alternating permutations of 1,2,...,n.

Original entry on oeis.org

1, 1, 2, 4, 6, 12, 28, 76, 240, 852, 3392, 14868, 71392, 371740, 2089184, 12589980, 81037792, 554555300, 4021728992, 30800978980, 248464000480, 2105271605804, 18696216008416, 173630895701996, 1683187452989920, 17000599430003444, 178625854452674272
Offset: 0

Author

David Bevan, Feb 10 2020

Keywords

Comments

A permutation w of 1,...,n is totally alternating if both w and w^{-1} are either alternating or reverse alternating.
Totally alternating permutations are those that avoid the consecutive patterns 123 and 321 and also the consecutive covincular patterns 123 and 321.
If a permutation is totally alternating, then so are its other 7 symmetries.

Examples

			The six totally alternating permutations of 1,...,4 are 1324, 2143, 2413, 3142, 3412 and 4231.
		

Crossrefs

For n > 1, a(n) = 2*(A007999(n) + A332344(n)).
For odd n > 1, a(n) = 4*A007999(n).
For even n > 1, a(n) = 4*A007999(n) - 2*A007999(n-2).

A332344 a(n) is the number of permutations w of 1,2,...,n such that w is alternating and w^{-1} is reverse alternating.

Original entry on oeis.org

1, 1, 0, 1, 1, 3, 6, 19, 56, 213, 816, 3717, 17408, 92935, 513152, 3147495, 19993728, 138638825, 995169664, 7700244745, 61608152704, 526317901451, 4642742078336, 43407723925499, 418444180284544, 4250149857500861, 44444888840063360
Offset: 0

Author

David Bevan, Feb 10 2020

Keywords

Examples

			The only alternating permutation of 1,2,3,4 whose inverse is reverse alternating is 2413.
The three alternating permutations of 1,...,5 whose inverses are reverse alternating are 24153, 24351 and 45231.
		

Crossrefs

For odd n, a(n) = A007999(n).
For even n > 1, a(n) = A007999(n) - A007999(n-2).
For n > 1, a(n) = A332345(n)/2 - A007999(n).

A327833 Number of non-overlapping pairs of adjacent runs in permutations of [n].

Original entry on oeis.org

1, 1, 4, 18, 100, 665, 5124, 44772, 437016, 4710915, 55568480, 711802894, 9838192572, 145921265581, 2311617527660, 38950657146120, 695562375445104, 13121344429311687, 260728755911619336, 5443039353326333330, 119101575356825879860, 2725785134463572716689
Offset: 1

Author

David Bevan, Sep 27 2019

Keywords

Comments

A run is a maximal consecutive subsequence of increasing values; two adjacent runs are non-overlapping if the least value in the first run exceeds the greatest value in the second.
Permutations all of whose adjacent runs overlap are in the image of the pop-stack sorting operation (see A307030 and references).

Examples

			a(3) = 4: one non-overlapping pair of adjacent runs in both 231 and 312, and two non-overlapping pairs in 321; the pairs of adjacent runs in 132 and 213 overlap.
		

Programs

  • Mathematica
    Table[If[n==1,1,(n-1)n!-(n/3-1/2)Floor[E n!]+(n/6-1/2)],{n,20}]

Formula

a(n) = (n-1)*n! - (n/3-1/2)*floor(e*n!) + (n/6-1/2), for all n > 1.
Asymptotically, the expected number of non-overlapping adjacent pairs of runs an n-permutation is (1-e/3)*n + (e/2-1).

A319321 a(n) is the number of d+/d- diagonally convex polyplets (polyominoes which need only touch at corners) with n cells.

Original entry on oeis.org

1, 4, 20, 108, 600, 3368, 18968, 106906, 602532, 3395402, 19131460, 107788900, 607274848
Offset: 1

Author

David Bevan, Sep 27 2018

Keywords

Comments

A polyplet is d+ [d-] diagonally convex if the intersection of its interior with any line of slope 1 [-1] through the centers of the cells is connected.

Examples

			The only tetraplets that are not d+ diagonally convex are two animals consisting of a horizontal domino and a vertical domino joined at a corner. So a(4) = A006770(4) - 2 = 108.
		

Crossrefs

Cf. A006770 (fixed polyplets), A187077 (row convex polyplets), A187276 (d+/d- diagonally convex polyominoes).

A319323 a(n) is the number of column convex polyiamonds with n cells.

Original entry on oeis.org

2, 3, 6, 14, 36, 94, 246, 645, 1682, 4367, 11312, 29261, 75654, 195607, 505794, 1307977, 3382628, 8748288, 22625594, 58516858, 151343298, 391422104, 1012341602
Offset: 1

Author

David Bevan, Sep 27 2018

Keywords

Comments

A polyiamond is column convex if the intersection of its interior with any vertical line through the centers of the cells is connected.

Examples

			The only septiamonds that are not column convex are four rotations/reflections of a "7" shape. So a(7) = A001420(7) - 4 = 246.
		

Crossrefs

Cf. A001420 (fixed polyiamonds), A238823 (row convex polyiamonds).

A319326 a(n) is the number of column convex polyglasses (polyiamonds which need only touch at corners) with n cells.

Original entry on oeis.org

2, 12, 84, 612, 4532, 33762, 252106, 1884120, 14084674, 105295512, 787178752
Offset: 1

Author

David Bevan, Sep 27 2018

Keywords

Comments

A polyglass is column convex if the intersection of its interior with any vertical line through the centers of the cells is connected.

Examples

			There are four triglasses that are not column convex. So a(2) = A319324(3) - 4 = 84.
		

Crossrefs

Cf. A319324 (fixed polyglasses), A319325 (row convex polyglasses), A319323 (column convex polyiamonds).