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

A351294 Numbers whose multiset of prime factors has at least one permutation with all distinct run-lengths.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 16, 17, 18, 19, 20, 23, 24, 25, 27, 28, 29, 31, 32, 37, 40, 41, 43, 44, 45, 47, 48, 49, 50, 52, 53, 54, 56, 59, 61, 63, 64, 67, 68, 71, 72, 73, 75, 76, 79, 80, 81, 83, 88, 89, 92, 96, 97, 98, 99, 101, 103, 104, 107, 108, 109
Offset: 1

Views

Author

Gus Wiseman, Feb 15 2022

Keywords

Comments

First differs from A130091 (Wilf partitions) in having 216.
See A239455 for the definition of Look-and-Say partitions.
The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.

Examples

			The terms together with their prime indices begin:
      1: ()            20: (3,1,1)         47: (15)
      2: (1)           23: (9)             48: (2,1,1,1,1)
      3: (2)           24: (2,1,1,1)       49: (4,4)
      4: (1,1)         25: (3,3)           50: (3,3,1)
      5: (3)           27: (2,2,2)         52: (6,1,1)
      7: (4)           28: (4,1,1)         53: (16)
      8: (1,1,1)       29: (10)            54: (2,2,2,1)
      9: (2,2)         31: (11)            56: (4,1,1,1)
     11: (5)           32: (1,1,1,1,1)     59: (17)
     12: (2,1,1)       37: (12)            61: (18)
     13: (6)           40: (3,1,1,1)       63: (4,2,2)
     16: (1,1,1,1)     41: (13)            64: (1,1,1,1,1,1)
     17: (7)           43: (14)            67: (19)
     18: (2,2,1)       44: (5,1,1)         68: (7,1,1)
     19: (8)           45: (3,2,2)         71: (20)
For example, the prime indices of 216 are {1,1,1,2,2,2}, and there are four permutations with distinct run-lengths: (1,1,2,2,2,1), (1,2,2,2,1,1), (2,1,1,1,2,2), (2,2,1,1,1,2); so 216 is in the sequence. It is the Heinz number of the Look-and-Say partition of (3,3,2,1).
		

Crossrefs

The Wilf case (distinct multiplicities) is A130091, counted by A098859.
The complement of the Wilf case is A130092, counted by A336866.
These partitions appear to be counted by A239455.
A variant for runs is A351201, counted by A351203 (complement A351204).
The complement is A351295, counted by A351293.
A032020 = number of binary expansions with distinct run-lengths.
A044813 = numbers whose binary expansion has all distinct run-lengths.
A056239 = sum of prime indices, row sums of A112798.
A165413 = number of run-lengths in binary expansion, for all runs A297770.
A181819 = Heinz number of prime signature (prime shadow).
A182850/A323014 = frequency depth, counted by A225485/A325280.
A320922 ranks graphical partitions, complement A339618, counted by A000569.
A329739 = compositions with all distinct run-lengths, for all runs A351013.
A333489 ranks anti-runs, complement A348612.
A351017 = binary words with all distinct run-lengths, for all runs A351016.
A351292 = patterns with all distinct run-lengths, for all runs A351200.

Programs

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

Extensions

Name edited by Gus Wiseman, Aug 13 2025

A351295 Numbers whose multiset of prime factors has no permutation with all distinct run-lengths.

Original entry on oeis.org

6, 10, 14, 15, 21, 22, 26, 30, 33, 34, 35, 36, 38, 39, 42, 46, 51, 55, 57, 58, 60, 62, 65, 66, 69, 70, 74, 77, 78, 82, 84, 85, 86, 87, 90, 91, 93, 94, 95, 100, 102, 105, 106, 110, 111, 114, 115, 118, 119, 120, 122, 123, 126, 129, 130, 132, 133, 134, 138, 140
Offset: 1

Views

Author

Gus Wiseman, Feb 16 2022

Keywords

Comments

First differs from A130092 (non-Wilf partitions) in lacking 216.
The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.

Examples

			The terms together with their prime indices begin:
      6: (2,1)         46: (9,1)         84: (4,2,1,1)
     10: (3,1)         51: (7,2)         85: (7,3)
     14: (4,1)         55: (5,3)         86: (14,1)
     15: (3,2)         57: (8,2)         87: (10,2)
     21: (4,2)         58: (10,1)        90: (3,2,2,1)
     22: (5,1)         60: (3,2,1,1)     91: (6,4)
     26: (6,1)         62: (11,1)        93: (11,2)
     30: (3,2,1)       65: (6,3)         94: (15,1)
     33: (5,2)         66: (5,2,1)       95: (8,3)
     34: (7,1)         69: (9,2)        100: (3,3,1,1)
     35: (4,3)         70: (4,3,1)      102: (7,2,1)
     36: (2,2,1,1)     74: (12,1)       105: (4,3,2)
     38: (8,1)         77: (5,4)        106: (16,1)
     39: (6,2)         78: (6,2,1)      110: (5,3,1)
     42: (4,2,1)       82: (13,1)       111: (12,2)
For example, the prime indices of 150 are {1,2,3,3}, with permutations and run-lengths (right):
  (3,3,2,1) -> (2,1,1)
  (3,3,1,2) -> (2,1,1)
  (3,2,3,1) -> (1,1,1,1)
  (3,2,1,3) -> (1,1,1,1)
  (3,1,3,2) -> (1,1,1,1)
  (3,1,2,3) -> (1,1,1,1)
  (2,3,3,1) -> (1,2,1)
  (2,3,1,3) -> (1,1,1,1)
  (2,1,3,3) -> (1,1,2)
  (1,3,3,2) -> (1,2,1)
  (1,3,2,3) -> (1,1,1,1)
  (1,2,3,3) -> (1,1,2)
Since none have all distinct run-lengths, 150 is in the sequence.
		

Crossrefs

Wilf partitions are counted by A098859, ranked by A130091.
Non-Wilf partitions are counted by A336866, ranked by A130092.
A variant for runs is A351201, counted by A351203 (complement A351204).
These partitions appear to be counted by A351293.
The complement is A351294, apparently counted by A239455.
A032020 = number of binary expansions with distinct run-lengths.
A044813 = numbers whose binary expansion has all distinct run-lengths.
A056239 = sum of prime indices, row sums of A112798.
A165413 = number of distinct run-lengths in binary expansion.
A181819 = Heinz number of prime signature (prime shadow).
A182850/A323014 = frequency depth, counted by A225485/A325280.
A297770 = number of distinct runs in binary expansion.
A320922 ranks graphical partitions, complement A339618, counted by A000569.
A329739 = compositions with all distinct run-lengths, for all runs A351013.
A329747 = runs-resistance, counted by A329746.
A333489 ranks anti-runs, complement A348612.
A351017 = binary words with all distinct run-lengths, for all runs A351016.

Programs

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

Extensions

Name edited by Gus Wiseman, Aug 13 2025

A333627 The a(n)-th composition in standard order is the sequence of run-lengths of the n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 3, 4, 1, 3, 2, 6, 3, 7, 5, 8, 1, 3, 3, 6, 3, 5, 7, 12, 3, 7, 6, 14, 5, 11, 9, 16, 1, 3, 3, 6, 2, 7, 7, 12, 3, 7, 4, 10, 7, 15, 13, 24, 3, 7, 7, 14, 7, 13, 15, 28, 5, 11, 10, 22, 9, 19, 17, 32, 1, 3, 3, 6, 3, 7, 7, 12, 3, 5, 6, 14, 7, 15, 13
Offset: 0

Views

Author

Gus Wiseman, Mar 30 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.

Examples

			The standard compositions and their run-lengths:
       0 ~ () -> () ~ 0
      1 ~ (1) -> (1) ~ 1
      2 ~ (2) -> (1) ~ 1
     3 ~ (11) -> (2) ~ 2
      4 ~ (3) -> (1) ~ 1
     5 ~ (21) -> (11) ~ 3
     6 ~ (12) -> (11) ~ 3
    7 ~ (111) -> (3) ~ 4
      8 ~ (4) -> (1) ~ 1
     9 ~ (31) -> (11) ~ 3
    10 ~ (22) -> (2) ~ 2
   11 ~ (211) -> (12) ~ 6
    12 ~ (13) -> (11) ~ 3
   13 ~ (121) -> (111) ~ 7
   14 ~ (112) -> (21) ~ 5
  15 ~ (1111) -> (4) ~ 8
     16 ~ (5) -> (1) ~ 1
    17 ~ (41) -> (11) ~ 3
    18 ~ (32) -> (11) ~ 3
   19 ~ (311) -> (12) ~ 6
		

Crossrefs

Positions of first appearances are A333630.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Runs-resistance is A333628.
- First appearances of run-resistances are A333629.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total[2^(Accumulate[Reverse[Length/@Split[stc[n]]]])]/2,{n,0,30}]

Formula

A000120(n) = A070939(a(n)).
A000120(a(n)) = A124767(n).

A329744 Triangle read by rows where T(n,k) is the number of compositions of n > 0 with runs-resistance k, 0 <= k <= n - 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 1, 1, 6, 6, 2, 1, 3, 15, 9, 4, 0, 1, 1, 22, 22, 16, 2, 0, 1, 3, 41, 38, 37, 8, 0, 0, 1, 2, 72, 69, 86, 26, 0, 0, 0, 1, 3, 129, 124, 175, 78, 2, 0, 0, 0, 1, 1, 213, 226, 367, 202, 14, 0, 0, 0, 0, 1, 5, 395, 376, 750, 469, 52, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers with sum n.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.

Examples

			Triangle begins:
   1
   1   1
   1   1   2
   1   2   3   2
   1   1   6   6   2
   1   3  15   9   4   0
   1   1  22  22  16   2   0
   1   3  41  38  37   8   0   0
   1   2  72  69  86  26   0   0   0
   1   3 129 124 175  78   2   0   0   0
   1   1 213 226 367 202  14   0   0   0   0
   1   5 395 376 750 469  52   0   0   0   0   0
Row n = 6 counts the following compositions:
  (6)  (33)      (15)    (114)    (1131)
       (222)     (24)    (411)    (1311)
       (111111)  (42)    (1113)   (11121)
                 (51)    (1221)   (12111)
                 (123)   (2112)
                 (132)   (3111)
                 (141)   (11112)
                 (213)   (11211)
                 (231)   (21111)
                 (312)
                 (321)
                 (1122)
                 (1212)
                 (2121)
                 (2211)
		

Crossrefs

Row sums are A000079.
Column k = 1 is A032741.
Column k = 2 is A329745.
Column k = n - 2 is A329743.
The version for partitions is A329746.
The version with rows reversed is A329750.

Programs

  • Mathematica
    runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1;
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],runsres[#]==k&]],{n,10},{k,0,n-1}]

A332642 Numbers whose negated unsorted prime signature is not unimodal.

Original entry on oeis.org

90, 126, 198, 234, 270, 306, 342, 350, 378, 414, 522, 525, 540, 550, 558, 594, 630, 650, 666, 702, 738, 756, 774, 810, 825, 846, 850, 918, 950, 954, 975, 990, 1026, 1050, 1062, 1078, 1098, 1134, 1150, 1170, 1188, 1206, 1242, 1274, 1275, 1278, 1314, 1350, 1386
Offset: 1

Views

Author

Gus Wiseman, Feb 28 2020

Keywords

Comments

A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
A number's prime signature (row n of A124010) is the sequence of positive exponents in its prime factorization.

Examples

			The sequence of terms together with their prime indices begins:
    90: {1,2,2,3}
   126: {1,2,2,4}
   198: {1,2,2,5}
   234: {1,2,2,6}
   270: {1,2,2,2,3}
   306: {1,2,2,7}
   342: {1,2,2,8}
   350: {1,3,3,4}
   378: {1,2,2,2,4}
   414: {1,2,2,9}
   522: {1,2,2,10}
   525: {2,3,3,4}
   540: {1,1,2,2,2,3}
   550: {1,3,3,5}
   558: {1,2,2,11}
   594: {1,2,2,2,5}
   630: {1,2,2,3,4}
   650: {1,3,3,6}
   666: {1,2,2,12}
   702: {1,2,2,2,6}
For example, 630 has negated unsorted prime signature (-1,-2,-1,-1), which is not unimodal, so 630 is in the sequence.
		

Crossrefs

These are the Heinz numbers of the partitions counted by A332639.
The case that is not unimodal either is A332643.
The version for compositions is A332669.
The complement is A332282.
Unimodal compositions are A001523.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Unsorted prime signature is A124010.
Non-unimodal normal sequences are A328509.
The number of non-unimodal negated permutations of a multiset whose multiplicities are the prime indices of n is A332742(n).
Partitions whose negated 0-appended first differences are not unimodal are A332744, with Heinz numbers A332832.

Programs

  • Mathematica
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]]
    Select[Range[2000],!unimodQ[-Last/@FactorInteger[#]]&]

A333628 Runs-resistance of the n-th composition in standard order. Number of steps taking run-lengths to reduce the n-th composition in standard order to a singleton.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 1, 0, 2, 1, 3, 2, 2, 3, 1, 0, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 4, 3, 4, 3, 1, 0, 2, 2, 3, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 3, 3, 2, 2, 2, 4, 2, 3, 2, 4, 3, 4, 2, 3, 3, 4, 3, 1, 0, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 4, 2, 2, 3, 3, 2, 2, 2, 4, 3, 3, 4
Offset: 1

Views

Author

Gus Wiseman, Mar 31 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.

Examples

			Starting with 13789 and repeatedly applying A333627 gives: 13789 -> 859 -> 110 -> 29 -> 11 -> 6 -> 3 -> 2, corresponding to the compositions: (1,2,2,1,1,2,1,1,2,1) -> (1,2,2,1,2,1,1) -> (1,2,1,1,2) -> (1,1,2,1) -> (2,1,1) -> (1,2) -> (1,1) -> (2), so a(13789) = 7.
		

Crossrefs

Number of times applying A333627 to reach a power of 2, starting with n.
Positions of first appearances are A333629.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- First appearances for specified run-lengths are A333630.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1;
    Table[runsres[stc[n]],{n,100}]

A329746 Triangle read by rows where T(n,k) is the number of integer partitions of n > 0 with runs-resistance k, 0 <= k <= n - 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 0, 1, 3, 4, 3, 0, 0, 1, 1, 4, 8, 1, 0, 0, 1, 3, 6, 10, 2, 0, 0, 0, 1, 2, 8, 13, 6, 0, 0, 0, 0, 1, 3, 11, 20, 7, 0, 0, 0, 0, 0, 1, 1, 11, 29, 14, 0, 0, 0, 0, 0, 0, 1, 5, 19, 31, 20, 1, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.

Examples

			Triangle begins:
  1
  1  1
  1  1  1
  1  2  1  1
  1  1  2  3  0
  1  3  4  3  0  0
  1  1  4  8  1  0  0
  1  3  6 10  2  0  0  0
  1  2  8 13  6  0  0  0  0
  1  3 11 20  7  0  0  0  0  0
  1  1 11 29 14  0  0  0  0  0  0
  1  5 19 31 20  1  0  0  0  0  0  0
  1  1 17 50 30  2  0  0  0  0  0  0  0
  1  3 25 64 37  5  0  0  0  0  0  0  0  0
  1  3 29 74 62  7  0  0  0  0  0  0  0  0  0
Row n = 8 counts the following partitions:
  (8)  (44)        (53)    (332)      (4211)
       (2222)      (62)    (422)      (32111)
       (11111111)  (71)    (611)
                   (431)   (3221)
                   (521)   (5111)
                   (3311)  (22211)
                           (41111)
                           (221111)
                           (311111)
                           (2111111)
		

Crossrefs

Row sums are A000041.
Column k = 1 is A032741.
Column k = 2 is A329745.
A similar invariant is frequency depth; see A323014, A325280.
The version for compositions is A329744.
The version for binary words is A329767.

Programs

  • Mathematica
    runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1;
    Table[Length[Select[IntegerPartitions[n],runsres[#]==k&]],{n,10},{k,0,n-1}]
  • PARI
    \\ rr(p) gives runs resistance of partition.
    rr(p)={my(r=0); while(#p > 1, my(L=List(), k=0); for(i=1, #p, if(i==#p||p[i]<>p[i+1], listput(L, i-k); k=i)); p=Vec(L); r++); r}
    row(n)={my(v=vector(n)); forpart(p=n, v[1+rr(Vec(p))]++); v}
    { for(n=1, 10, print(row(n))) } \\ Andrew Howroyd, Jan 19 2023

A319411 Triangle read by rows: T(n,k) = number of binary vectors of length n with runs-resistance k (1 <= k <= n).

Original entry on oeis.org

2, 2, 2, 2, 2, 4, 2, 4, 6, 4, 2, 2, 12, 12, 4, 2, 6, 30, 18, 8, 0, 2, 2, 44, 44, 32, 4, 0, 2, 6, 82, 76, 74, 16, 0, 0, 2, 4, 144, 138, 172, 52, 0, 0, 0, 2, 6, 258, 248, 350, 156, 4, 0, 0, 0, 2, 2, 426, 452, 734, 404, 28, 0, 0, 0, 0, 2, 10, 790, 752, 1500, 938, 104, 0, 0, 0, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Sep 20 2018

Keywords

Comments

"Runs-resistance" is defined in A318928.
Row sums are 2,4,8,16,... (the binary vectors may begin with 0 or 1).
This is similar to A329767 but without the k = 0 column and with a different row n = 1. - Gus Wiseman, Nov 25 2019

Examples

			Triangle begins:
2,
2, 2,
2, 2, 4,
2, 4, 6, 4,
2, 2, 12, 12, 4,
2, 6, 30, 18, 8, 0,
2, 2, 44, 44, 32, 4, 0,
2, 6, 82, 76, 74, 16, 0, 0,
2, 4, 144, 138, 172, 52, 0, 0, 0,
2, 6, 258, 248, 350, 156, 4, 0, 0, 0,
2, 2, 426, 452, 734, 404, 28, 0, 0, 0, 0,
2, 10, 790, 752, 1500, 938, 104, 0, 0, 0, 0, 0,
...
Lenormand gives the first 20 rows.
The calculation of row 4 is as follows.
We may assume the first bit is a 0, and then double the answers.
vector / runs / steps to reach a single number:
0000 / 4 / 1
0001 / 31 -> 11 -> 2 / 3
0010 / 211 -> 12 -> 11 -> 2 / 4
0011 / 22 -> 2 / 2
0100 / 112 -> 21 -> 11 -> 2 / 4
0101 / 1111 -> 4 / 2
0110 / 121 -> 111 -> 3 / 3
0111 / 13 -> 11 -> 2 / 3
and we get 1 (once), 2 (twice), 3 (three times) and 4 (twice).
So row 4 is: 2,4,6,4.
		

Crossrefs

Row sums are A000079.
Column k = 2 is 2 * A032741 = A319410.
Column k = 3 is 2 * A329745 (because runs-resistance 2 for compositions corresponds to runs-resistance 3 for binary words).
The version for compositions is A329744.
The version for partitions is A329746.
The number of nonzero entries in row n > 0 is A319412(n).
The runs-resistance of the binary expansion of n is A318928.

Programs

  • Mathematica
    runsresist[q_]:=If[Length[q]==1,1,Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1];
    Table[Length[Select[Tuples[{0,1},n],runsresist[#]==k&]],{n,10},{k,n}] (* Gus Wiseman, Nov 25 2019 *)

A329745 Number of compositions of n with runs-resistance 2.

Original entry on oeis.org

0, 0, 2, 3, 6, 15, 22, 41, 72, 129, 213, 395, 660, 1173, 2031, 3582, 6188, 10927, 18977, 33333, 58153, 101954, 178044, 312080, 545475, 955317, 1670990, 2925711, 5118558, 8960938, 15680072, 27447344, 48033498, 84076139, 147142492, 257546234, 450748482, 788937188
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers with sum n.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.
These are non-constant compositions with equal run-lengths (A329738).

Examples

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

Crossrefs

Column k = 2 of A329744.
Column k = n - 2 of A329750.

Programs

  • Mathematica
    runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1;
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],runsres[#]==2&]],{n,10}]
  • PARI
    seq(n)={my(b=Vec(1/(1 - sum(k=1, n, x^k/(1+x^k) + O(x*x^n)))-1)); vector(n, k, sumdiv(k, d, b[d]-1))} \\ Andrew Howroyd, Dec 30 2020

Formula

a(n) = A329738(n) - A000005(n).
a(n) = Sum_{d|n} (A003242(d) - 1). - Andrew Howroyd, Dec 30 2020

Extensions

Terms a(21) and beyond from Andrew Howroyd, Dec 30 2020

A329767 Triangle read by rows where T(n,k) is the number of binary words of length n >= 0 with runs-resistance k, 0 <= k <= n.

Original entry on oeis.org

1, 2, 0, 0, 2, 2, 0, 2, 2, 4, 0, 2, 4, 6, 4, 0, 2, 2, 12, 12, 4, 0, 2, 6, 30, 18, 8, 0, 0, 2, 2, 44, 44, 32, 4, 0, 0, 2, 6, 82, 76, 74, 16, 0, 0, 0, 2, 4, 144, 138, 172, 52, 0, 0, 0, 0, 2, 6, 258, 248, 350, 156, 4, 0, 0, 0, 0, 2, 2, 426, 452, 734, 404, 28, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers with sum n.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.
Except for the k = 0 column and the n = 0 and n = 1 rows, this is the triangle appearing on page 3 of Lenormand, which is A319411. Unlike A318928, we do not here require that a(n) >= 1.
The n = 0 row is chosen to ensure that the row-sums are A000079, although the empty word arguably has indeterminate runs-resistance.

Examples

			Triangle begins:
   1
   2   0
   0   2   2
   0   2   2   4
   0   2   4   6   4
   0   2   2  12  12   4
   0   2   6  30  18   8   0
   0   2   2  44  44  32   4   0
   0   2   6  82  76  74  16   0   0
   0   2   4 144 138 172  52   0   0   0
   0   2   6 258 248 350 156   4   0   0   0
   0   2   2 426 452 734 404  28   0   0   0   0
For example, row n = 4 counts the following words:
  0000  0011  0001  0010
  1111  0101  0110  0100
        1010  0111  1011
        1100  1000  1101
              1001
              1110
		

Crossrefs

Row sums are A000079.
Column k = 2 is A319410.
Column k = 3 is 2 * A329745.
The version for compositions is A329744.
The version for partitions is A329746.
The number of nonzero entries in row n > 0 is A319412(n).
The runs-resistance of the binary expansion of n is A318928.

Programs

  • Mathematica
    runsres[q_]:=If[Length[q]==1,0,Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1];
    Table[Length[Select[Tuples[{0,1},n],runsres[#]==k&]],{n,0,10},{k,0,n}]
Showing 1-10 of 27 results. Next