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

A351290 Numbers k such that the k-th composition in standard order has all distinct runs.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 50, 51, 52, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 78
Offset: 1

Views

Author

Gus Wiseman, Feb 10 2022

Keywords

Comments

The n-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of n, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms together with their binary expansions and corresponding compositions begin:
   0:      0  ()
   1:      1  (1)
   2:     10  (2)
   3:     11  (1,1)
   4:    100  (3)
   5:    101  (2,1)
   6:    110  (1,2)
   7:    111  (1,1,1)
   8:   1000  (4)
   9:   1001  (3,1)
  10:   1010  (2,2)
  11:   1011  (2,1,1)
  12:   1100  (1,3)
  14:   1110  (1,1,2)
  15:   1111  (1,1,1,1)
		

Crossrefs

The version for Heinz numbers and prime multiplicities is A130091.
The version using binary expansions is A175413, complement A351205.
The version for run-lengths instead of runs is A329739.
These compositions are counted by A351013.
The complement is A351291.
A005811 counts runs in binary expansion, distinct A297770.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612.
A345167 ranks alternating compositions, counted by A025047.
A351204 counts partitions where every permutation has all distinct runs.
Counting words with all distinct runs:
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions:
- Length is A000120.
- Parts are A066099, reverse A228351.
- Sum is A070939.
- Runs are counted by A124767, distinct A351014.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@Split[stc[#]]&]

A351291 Numbers k such that the k-th composition in standard order does not have all distinct runs.

Original entry on oeis.org

13, 22, 25, 45, 46, 49, 53, 54, 59, 76, 77, 82, 89, 91, 93, 94, 97, 101, 102, 105, 108, 109, 110, 115, 118, 141, 148, 150, 153, 156, 162, 165, 166, 173, 177, 178, 180, 181, 182, 183, 187, 189, 190, 193, 197, 198, 201, 204, 205, 209, 210, 213, 214, 216, 217
Offset: 1

Views

Author

Gus Wiseman, Feb 12 2022

Keywords

Comments

The n-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of n, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms together with their binary expansions and corresponding compositions begin:
  13:     1101  (1,2,1)
  22:    10110  (2,1,2)
  25:    11001  (1,3,1)
  45:   101101  (2,1,2,1)
  46:   101110  (2,1,1,2)
  49:   110001  (1,4,1)
  53:   110101  (1,2,2,1)
  54:   110110  (1,2,1,2)
  59:   111011  (1,1,2,1,1)
  76:  1001100  (3,1,3)
  77:  1001101  (3,1,2,1)
  82:  1010010  (2,3,2)
  89:  1011001  (2,1,3,1)
  91:  1011011  (2,1,2,1,1)
  93:  1011101  (2,1,1,2,1)
  94:  1011110  (2,1,1,1,2)
		

Crossrefs

The version for Heinz numbers of partitions is A130092, complement A130091.
Normal multisets with a permutation of this type appear to be A283353.
Partitions w/o permutations of this type are A351204, complement A351203.
The version using binary expansions is A351205, complement A175413.
The complement is A351290, counted by A351013.
A005811 counts runs in binary expansion, distinct A297770.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has all distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612, counted by A003242.
A345167 ranks alternating compositions, counted by A025047.
Counting words with all distinct runs:
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions (A066099, reverse A228351):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767, distinct A351014.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!UnsameQ@@Split[stc[#]]&]

A345169 Numbers k such that the k-th composition in standard order is a non-alternating anti-run.

Original entry on oeis.org

37, 52, 69, 101, 104, 105, 133, 137, 150, 165, 180, 197, 200, 208, 209, 210, 261, 265, 274, 278, 300, 301, 308, 325, 328, 357, 360, 361, 389, 393, 400, 401, 406, 416, 417, 418, 421, 422, 436, 517, 521, 529, 530, 534, 549, 550, 556, 557, 564, 581, 600, 601, 613
Offset: 1

Views

Author

Gus Wiseman, Jun 15 2021

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
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 sequence of terms together with their binary indices begins:
     37: (3,2,1)      210: (1,2,3,2)      400: (1,3,5)
     52: (1,2,3)      261: (6,2,1)        401: (1,3,4,1)
     69: (4,2,1)      265: (5,3,1)        406: (1,3,2,1,2)
    101: (1,3,2,1)    274: (4,3,2)        416: (1,2,6)
    104: (1,2,4)      278: (4,2,1,2)      417: (1,2,5,1)
    105: (1,2,3,1)    300: (3,2,1,3)      418: (1,2,4,2)
    133: (5,2,1)      301: (3,2,1,2,1)    421: (1,2,3,2,1)
    137: (4,3,1)      308: (3,1,2,3)      422: (1,2,3,1,2)
    150: (3,2,1,2)    325: (2,4,2,1)      436: (1,2,1,2,3)
    165: (2,3,2,1)    328: (2,3,4)        517: (7,2,1)
    180: (2,1,2,3)    357: (2,1,3,2,1)    521: (6,3,1)
    197: (1,4,2,1)    360: (2,1,2,4)      529: (5,4,1)
    200: (1,3,4)      361: (2,1,2,3,1)    530: (5,3,2)
    208: (1,2,5)      389: (1,5,2,1)      534: (5,2,1,2)
    209: (1,2,4,1)    393: (1,4,3,1)      549: (4,3,2,1)
		

Crossrefs

A version counting partitions is A345166, ranked by A345173.
These compositions are counted by A345195.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A005649 counts anti-run patterns.
A025047 counts alternating or wiggly compositions, also A025048, A025049.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A345164 counts alternating permutations of prime indices.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A345192 counts non-alternating compositions.
A345194 counts alternating patterns (with twins: A344605).
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Anti-runs are A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
- Non-anti-runs are A348612.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Strictly increasing compositions (sets) are A333255.
- Strictly decreasing compositions (strict partitions) are A333256.
- Anti-runs are A333489.
- Alternating compositions are A345167.
- Non-Alternating compositions are A345168.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    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_,_}];
    Select[Range[0,1000],sepQ[stc[#]]&&!wigQ[stc[#]]&]

Formula

Intersection of A345168 (non-alternating) and A333489 (anti-run).

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

A351201 Numbers whose multiset of prime factors has a permutation without all distinct runs.

Original entry on oeis.org

12, 18, 20, 28, 36, 44, 45, 48, 50, 52, 60, 63, 68, 72, 75, 76, 80, 84, 90, 92, 98, 99, 100, 108, 112, 116, 117, 120, 124, 126, 132, 140, 144, 147, 148, 150, 153, 156, 162, 164, 168, 171, 172, 175, 176, 180, 188, 192, 196, 198, 200, 204, 207, 208, 212, 216
Offset: 1

Views

Author

Gus Wiseman, Feb 12 2022

Keywords

Examples

			The prime factors of 80 are {2,2,2,2,5} and the permutation (2,2,5,2,2) has runs (2,2), (5), and (2,2), which are not all distinct, so 80 is in the sequence. On the other hand, 24 has prime factors {2,2,2,3}, and all four permutations (3,2,2,2), (2,3,2,2), (2,2,3,2), (2,2,2,3) have distinct runs, so 24 is not in the sequence.
The terms and their prime indices begin:
     12: (2,1,1)         76: (8,1,1)        132: (5,2,1,1)
     18: (2,2,1)         80: (3,1,1,1,1)    140: (4,3,1,1)
     20: (3,1,1)         84: (4,2,1,1)      144: (2,2,1,1,1,1)
     28: (4,1,1)         90: (3,2,2,1)      147: (4,4,2)
     36: (2,2,1,1)       92: (9,1,1)        148: (12,1,1)
     44: (5,1,1)         98: (4,4,1)        150: (3,3,2,1)
     45: (3,2,2)         99: (5,2,2)        153: (7,2,2)
     48: (2,1,1,1,1)    100: (3,3,1,1)      156: (6,2,1,1)
     50: (3,3,1)        108: (2,2,2,1,1)    162: (2,2,2,2,1)
     52: (6,1,1)        112: (4,1,1,1,1)    164: (13,1,1)
     60: (3,2,1,1)      116: (10,1,1)       168: (4,2,1,1,1)
     63: (4,2,2)        117: (6,2,2)        171: (8,2,2)
     68: (7,1,1)        120: (3,2,1,1,1)    172: (14,1,1)
     72: (2,2,1,1,1)    124: (11,1,1)       175: (4,3,3)
     75: (3,3,2)        126: (4,2,2,1)      176: (5,1,1,1,1)
		

Crossrefs

The version for run-lengths instead of runs is A024619.
These permutations are counted by A351202.
These rank the partitions counted by A351203, complement A351204.
A005811 counts runs in binary expansion.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A056239 adds up prime indices, row sums of A112798.
A283353 counts normal multisets with a permutation w/o all distinct runs.
A297770 counts distinct runs in binary expansion.
A333489 ranks anti-runs, complement A348612.
A351014 counts distinct runs in standard compositions, firsts A351015.
A351291 ranks compositions without all distinct runs.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739, ranked by A351290.
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
- A351200 = patterns, for run-lengths A351292.

Programs

  • Mathematica
    Select[Range[100],Select[Permutations[Join@@ ConstantArray@@@FactorInteger[#]],!UnsameQ@@Split[#]&]!={}&]

A069321 Stirling transform of A001563: a(0) = 1 and a(n) = Sum_{k=1..n} Stirling2(n,k)*k*k! for n >= 1.

Original entry on oeis.org

1, 1, 5, 31, 233, 2071, 21305, 249271, 3270713, 47580151, 760192505, 13234467511, 249383390393, 5057242311031, 109820924003705, 2542685745501751, 62527556173577273, 1627581948113854711, 44708026328035782905, 1292443104462527895991, 39223568601129844839353
Offset: 0

Views

Author

Karol A. Penson, Mar 14 2002

Keywords

Comments

The number of compatible bipartitions of a set of cardinality n for which at least one subset is not underlined. E.g., for n=2 there are 5 such bipartitions: {1 2}, {1}{2}, {2}{1}, {1}{2}, {2}{1}. A005649 is the number of bipartitions of a set of cardinality n. A000670 is the number of bipartitions of a set of cardinality n with none of the subsets underlined. - Kyle Petersen, Mar 31 2005
a(n) is the cardinality of the image set summed over "all surjections". All surjections means: onto functions f:{1, 2, ..., n} -> {1, 2, ..., k} for every k, 1 <= k <= n. a(n) = Sum_{k=1..n} A019538(n, k)*k. - Geoffrey Critzer, Nov 12 2012
From Gus Wiseman, Jan 15 2022: (Start)
For n > 1, also the number of finite sequences of length n + 1 covering an initial interval of positive integers with at least two adjacent equal parts, or non-anti-run patterns, ranked by the intersection of A348612 and A333217. The complement is counted by A005649. For example, the a(3) = 31 patterns, grouped by sum, are:
(1111) (1222) (1122) (1112) (1233) (1223)
(2122) (1221) (1121) (1332) (1322)
(2212) (2112) (1211) (2133) (2213)
(2221) (2211) (2111) (2331) (2231)
(1123) (3312) (3122)
(1132) (3321) (3221)
(2113)
(2311)
(3112)
(3211)
Also the number of ordered set partitions of {1,...,n + 1} with two successive vertices together in some block.
(End)

Crossrefs

The complement is counted by A005649.
A version for permutations of prime indices is A336107.
A version for factorizations is A348616.
Dominated (n > 1) by A350252, complement A345194, compositions A345192.
A000670 = patterns, ranked by A333217.
A001250 = alternating permutations, complement A348615.
A003242 = anti-run compositions, ranked by A333489.
A019536 = necklace patterns.
A226316 = patterns avoiding (1,2,3), weakly A052709, complement A335515.
A261983 = not-anti-run compositions, ranked by A348612.
A333381 = anti-runs of standard compositions.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1,
          add(b(n-j)*binomial(n, j), j=1..n))
        end:
    a:= n-> `if`(n=0, 2, b(n+1)-b(n))/2:
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 02 2018
  • Mathematica
    max = 20; t = Sum[n^(n - 1)x^n/n!, {n, 1, max}]; Range[0, max]!CoefficientList[Series[D[1/(1 - y(Exp[x] - 1)), y] /. y -> 1, {x, 0, max}], x] (* Geoffrey Critzer, Nov 12 2012 *)
    Prepend[Table[Sum[StirlingS2[n, k]*k*k!, {k, n}], {n, 18}], 1] (* Michael De Vlieger, Jan 03 2016 *)
    a[n_] := (PolyLog[-n-1, 1/2] - PolyLog[-n, 1/2])/4; a[0] = 1; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 30 2016 *)
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],MemberQ[Differences[#],0]&]],{n,0,8}] (* Gus Wiseman, Jan 15 2022 *)
  • PARI
    {a(n)=polcoeff(1+sum(m=1, n, (2*m-1)!/(m-1)!*x^m/prod(k=1, m, 1+(m+k-1)*x+x*O(x^n))), n)} \\ Paul D. Hanna, Oct 28 2013

Formula

Representation as an infinite series: a(0) = 1 and a(n) = Sum_{k>=2} (k^n*(k-1)/(2^k))/4 for n >= 1. This is a Dobinski-type summation formula.
E.g.f.: (exp(x) - 1)/((2 - exp(x))^2).
a(n) = (1/2)*(A000670(n+1) - A000670(n)).
O.g.f.: 1 + Sum_{n >= 1} (2*n-1)!/(n-1)! * x^n / (Product_{k=1..n} (1 + (n + k - 1)*x)). - Paul D. Hanna, Oct 28 2013
a(n) = (A000629(n+1) - A000629(n))/4. - Benoit Cloitre, Oct 20 2002
a(n) = A232472(n-1)/2. - Vincenzo Librandi, Jan 03 2016
a(n) ~ n! * n / (4 * (log(2))^(n+2)). - Vaclav Kotesovec, Jul 01 2018
a(n > 0) = A000607(n + 1) - A005649(n). - Gus Wiseman, Jan 15 2022

A349800 Number of integer compositions of n that are weakly alternating and have at least two adjacent equal parts.

Original entry on oeis.org

0, 0, 1, 1, 4, 9, 16, 33, 62, 113, 205, 373, 664, 1190, 2113, 3744, 6618, 11683, 20564, 36164, 63489, 111343, 195042, 341357, 596892, 1042976, 1821179, 3178145, 5543173, 9663545, 16839321, 29332231, 51075576, 88908912, 154722756, 269186074, 468221264
Offset: 0

Views

Author

Gus Wiseman, Dec 16 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.
This sequence counts compositions that are weakly but not strongly alternating; also weakly alternating non-anti-run compositions.

Examples

			The a(2) = 1 through a(6) = 16 compositions:
  (1,1)  (1,1,1)  (2,2)      (1,1,3)      (3,3)
                  (1,1,2)    (1,2,2)      (1,1,4)
                  (2,1,1)    (2,2,1)      (2,2,2)
                  (1,1,1,1)  (3,1,1)      (4,1,1)
                             (1,1,1,2)    (1,1,1,3)
                             (1,1,2,1)    (1,1,2,2)
                             (1,2,1,1)    (1,1,3,1)
                             (2,1,1,1)    (1,3,1,1)
                             (1,1,1,1,1)  (2,2,1,1)
                                          (3,1,1,1)
                                          (1,1,1,1,2)
                                          (1,1,1,2,1)
                                          (1,1,2,1,1)
                                          (1,2,1,1,1)
                                          (2,1,1,1,1)
                                          (1,1,1,1,1,1)
		

Crossrefs

This is the weakly alternating case of A345192, ranked by A345168.
The case of partitions is A349795, ranked by A350137.
The version counting permutations of prime indices is A349798.
These compositions are ranked by A349799.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A003242 = Carlitz (anti-run) compositions, ranked by A333489.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A261983 = non-anti-run compositions, ranked by A348612.
A345165 = partitions without an alternating permutation, ranked by A345171.
A345170 = partitions with an alternating permutation, ranked by A345172.
A345173 = non-alternating anti-run partitions, ranked by A345166.
A345195 = non-alternating anti-run compositions, ranked by A345169.
A348377 = non-alternating non-twin compositions.
A349801 = non-alternating partitions, ranked by A289553.
Weakly alternating:
- A349052 = compositions, directed A129852/A129853, complement A349053.
- A349056 = permutations of prime indices, complement A349797.
- A349057 = complement of standard composition numbers (too dense).
- A349058 = patterns, complement A350138.
- A349059 = ordered factorizations, complement A350139.
- A349060 = partitions, complement A349061.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y] &&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],(whkQ[#]||whkQ[-#])&&!wigQ[#]&]],{n,0,10}]

Formula

a(n) = A349052(n) - A025047(n). - Andrew Howroyd, Jan 31 2024

Extensions

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

A349799 Numbers k such that the k-th composition in standard order is weakly alternating but has at least two adjacent equal parts.

Original entry on oeis.org

3, 7, 10, 11, 14, 15, 19, 21, 23, 26, 27, 28, 29, 30, 31, 35, 36, 39, 42, 43, 47, 51, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 71, 73, 74, 79, 83, 84, 85, 86, 87, 90, 91, 94, 95, 99, 100, 103, 106, 111, 112, 113, 114, 115, 118, 119, 120, 121, 122, 123, 124, 125
Offset: 1

Views

Author

Gus Wiseman, Dec 15 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
This sequence ranks compositions that are weakly but not strongly alternating.

Examples

			The terms and corresponding compositions begin:
   3: (1,1)
   7: (1,1,1)
  10: (2,2)
  11: (2,1,1)
  14: (1,1,2)
  15: (1,1,1,1)
  19: (3,1,1)
  21: (2,2,1)
  23: (2,1,1,1)
  26: (1,2,2)
  27: (1,2,1,1)
  28: (1,1,3)
  29: (1,1,2,1)
  30: (1,1,1,2)
  31: (1,1,1,1,1)
		

Crossrefs

Partitions of this type are counted by A349795, ranked by A350137.
Permutations of prime indices of this type are counted by A349798.
These compositions are counted by A349800.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A003242 = Carlitz (anti-run) compositions, ranked by A333489.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A261983 = non-anti-run compositions, ranked by A348612.
A345164 = alternating permutations of prime indices, with twins A344606.
A345165 = partitions without an alternating permutation, ranked by A345171.
A345170 = partitions with an alternating permutation, ranked by A345172.
A345166 = separable partitions with no alternations, ranked by A345173.
A345192 = non-alternating compositions, ranked by A345168.
A345195 = non-alternating anti-run compositions, ranked by A345169.
A349052/A129852/A129853 = weakly alternating compositions.
A349053 = non-weakly alternating compositions, ranked by A349057.
A349056 = weak alternations of prime indices, complement A349797.
A349060 = weak alternations of partitions, complement A349061.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Select[Range[0,100],(whkQ[stc[#]]||whkQ[-stc[#]])&&MatchQ[stc[#],{_,x_,x_,_}]&]

Formula

A348611 Number of ordered factorizations of n with no adjacent equal factors.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 6, 1, 3, 3, 4, 1, 6, 1, 6, 3, 3, 1, 14, 1, 3, 3, 6, 1, 13, 1, 7, 3, 3, 3, 17, 1, 3, 3, 14, 1, 13, 1, 6, 6, 3, 1, 29, 1, 6, 3, 6, 1, 14, 3, 14, 3, 3, 1, 36, 1, 3, 6, 14, 3, 13, 1, 6, 3, 13, 1, 45, 1, 3, 6, 6, 3, 13, 1, 29, 4, 3
Offset: 1

Views

Author

Gus Wiseman, Nov 07 2021

Keywords

Comments

First differs from A348610 at a(24) = 14, A348610(24) = 12.
An ordered factorization of n is a finite sequence of positive integers > 1 with product n.
In analogy with Carlitz compositions, these may be called Carlitz ordered factorizations.

Examples

			The a(n) ordered factorizations without adjacent equal factors for n = 1, 6, 12, 16, 24, 30, 32, 36 are:
  ()   6     12      16      24      30      32      36
       2*3   2*6     2*8     3*8     5*6     4*8     4*9
       3*2   3*4     8*2     4*6     6*5     8*4     9*4
             4*3     2*4*2   6*4     10*3    16*2    12*3
             6*2             8*3     15*2    2*16    18*2
             2*3*2           12*2    2*15    2*8*2   2*18
                             2*12    3*10    4*2*4   3*12
                             2*3*4   2*3*5           2*3*6
                             2*4*3   2*5*3           2*6*3
                             2*6*2   3*2*5           2*9*2
                             3*2*4   3*5*2           3*2*6
                             3*4*2   5*2*3           3*4*3
                             4*2*3   5*3*2           3*6*2
                             4*3*2                   6*2*3
                                                     6*3*2
                                                     2*3*2*3
                                                     3*2*3*2
Thus, of total A074206(12) = 8 ordered factorizations of 12, only factorizations 2*2*3 and 3*2*2 (see A348616) are not included in this count, therefore a(12) = 6. - _Antti Karttunen_, Nov 12 2021
		

Crossrefs

The additive version (compositions) is A003242, complement A261983.
The additive alternating version is A025047, ranked by A345167.
Factorizations without a permutation of this type are counted by A333487.
As compositions these are ranked by A333489, complement A348612.
Factorizations with a permutation of this type are counted by A335434.
The non-alternating additive version is A345195, ranked by A345169.
The alternating case is A348610, which is dominated at positions A122181.
The complement is counted by A348616.
A001055 counts factorizations, strict A045778, ordered A074206.
A325534 counts separable partitions, ranked by A335433.
A335452 counts anti-run permutations of prime indices, complement A336107.
A339846 counts even-length factorizations.
A339890 counts odd-length factorizations.
A348613 counts non-alternating ordered factorizations.

Programs

  • Mathematica
    ordfacs[n_]:=If[n<=1,{{}},Join@@Table[Prepend[#,d]&/@ordfacs[n/d],{d,Rest[Divisors[n]]}]];
    antirunQ[y_]:=Length[y]==Length[Split[y]]
    Table[Length[Select[ordfacs[n],antirunQ]],{n,100}]
  • PARI
    A348611(n, e=0) = if(1==n, 1, my(s=0); fordiv(n, d, if((d>1)&&(d!=e), s += A348611(n/d, d))); (s)); \\ Antti Karttunen, Nov 12 2021

Formula

a(n) = A074206(n) - A348616(n).

A348382 Number of compositions of n that are not a twin (x,x) but have adjacent equal parts.

Original entry on oeis.org

0, 0, 0, 1, 3, 9, 17, 41, 88, 185, 387, 810, 1669, 3435, 7039, 14360, 29225, 59347, 120228, 243166, 491085, 990446, 1995409, 4016259, 8076959, 16231746, 32599773, 65437945, 131293191, 263316897, 527912139, 1058061751, 2120039884, 4246934012, 8505864639
Offset: 0

Views

Author

Gus Wiseman, Nov 05 2021

Keywords

Comments

A composition with no adjacent equal parts is also called a Carlitz composition, so these are non-twin, non-Carlitz compositions.

Examples

			The a(3) = 1 through a(6) = 17 compositions:
  (111)  (112)   (113)    (114)
         (211)   (122)    (222)
         (1111)  (221)    (411)
                 (311)    (1113)
                 (1112)   (1122)
                 (1121)   (1131)
                 (1211)   (1221)
                 (2111)   (1311)
                 (11111)  (2112)
                          (2211)
                          (3111)
                          (11112)
                          (11121)
                          (11211)
                          (12111)
                          (21111)
                          (111111)
		

Crossrefs

Allowing twins gives A261983, complement A003242.
The non-alternating case is A348377, difference A345195.
These compositions are ranked by A348612 \ A007582.
A001250 counts alternating permutations, complement A348615.
A007582 ranks twin compositions.
A011782 counts compositions, strict A032020.
A025047 counts alternating or wiggly compositions, complement A345192.
A051049 counts non-twin compositions, complement A000035(n+1).
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.

Programs

  • Mathematica
    nn=15;CoefficientList[Series[1+x/(1-2x)-x^2/(1-x^2)-1/(1-Sum[x^k/(1+x^k),{k,1,nn}]),{x,0,nn}],x]

Formula

For n > 0, a(n) = A261983(n) - A059841(n).
O.g.f.: 1 + x/(1-2x) - x^2/(1-x^2) - 1/(1 - Sum_{k>0} x^k/(1+x^k)).
Previous Showing 11-20 of 32 results. Next