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.

A345195 Number of non-alternating anti-run compositions of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 4, 10, 23, 49, 96, 192, 368, 692, 1299, 2403, 4400, 8029, 14556, 26253, 47206, 84574, 151066, 269244, 478826, 849921, 1506309, 2665829, 4711971, 8319763, 14675786, 25865400, 45552678, 80171353, 141015313, 247905305, 435614270, 765132824
Offset: 0

Views

Author

Gus Wiseman, Jun 17 2021

Keywords

Comments

A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
An anti-run (separation or Carlitz composition) is a sequence with no adjacent equal parts.

Examples

			The a(9) = 23 anti-runs:
  (1,2,6)  (1,2,4,2)  (1,2,1,2,3)
  (1,3,5)  (1,2,5,1)  (1,2,3,1,2)
  (2,3,4)  (1,3,4,1)  (1,2,3,2,1)
  (4,3,2)  (1,4,3,1)  (1,3,2,1,2)
  (5,3,1)  (1,5,2,1)  (2,1,2,3,1)
  (6,2,1)  (2,1,2,4)  (2,1,3,2,1)
           (2,4,2,1)  (3,2,1,2,1)
           (3,1,2,3)
           (3,2,1,3)
           (4,2,1,2)
		

Crossrefs

Non-anti-run compositions are counted by A261983.
A version counting partitions is A345166, ranked by A345173.
These compositions are ranked by A345169.
Non-alternating compositions are counted by A345192, ranked by A345168.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A345164 counts alternating permutations of prime indices, w/ twins A344606.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A345194 counts alternating patterns (with twins: A344605).

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    sepQ[y_]:=!MatchQ[y,{_,x_,x_,_}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], sepQ[#]&&!wigQ[#]&]],{n,0,15}]

Formula

a(n) = A003242(n) - A025047(n).

Extensions

a(21) onwards from Andrew Howroyd, Jan 31 2024