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

A345167 Numbers k such that the k-th composition in standard order is alternating.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 16, 17, 18, 20, 22, 24, 25, 32, 33, 34, 38, 40, 41, 44, 45, 48, 49, 50, 54, 64, 65, 66, 68, 70, 72, 76, 77, 80, 81, 82, 88, 89, 96, 97, 98, 102, 108, 109, 128, 129, 130, 132, 134, 140, 141, 144, 145, 148, 152, 153, 160, 161, 162
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).

Examples

			The terms together with their binary indices begin:
      1: (1)         25: (1,3,1)       66: (5,2)
      2: (2)         32: (6)           68: (4,3)
      4: (3)         33: (5,1)         70: (4,1,2)
      5: (2,1)       34: (4,2)         72: (3,4)
      6: (1,2)       38: (3,1,2)       76: (3,1,3)
      8: (4)         40: (2,4)         77: (3,1,2,1)
      9: (3,1)       41: (2,3,1)       80: (2,5)
     12: (1,3)       44: (2,1,3)       81: (2,4,1)
     13: (1,2,1)     45: (2,1,2,1)     82: (2,3,2)
     16: (5)         48: (1,5)         88: (2,1,4)
     17: (4,1)       49: (1,4,1)       89: (2,1,3,1)
     18: (3,2)       50: (1,3,2)       96: (1,6)
     20: (2,3)       54: (1,2,1,2)     97: (1,5,1)
     22: (2,1,2)     64: (7)           98: (1,4,2)
     24: (1,4)       65: (6,1)        102: (1,3,1,2)
		

Crossrefs

These compositions are counted by A025047, complement A345192.
The complement is A345168.
Partitions with a permutation of this type: A345170, complement A345165.
Factorizations with a permutation of this type: A348379.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A345164 counts alternating permutations of prime indices.
A345194 counts alternating patterns, with twins A344605.
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Number of maximal anti-runs is A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Anti-runs are A333489.
- Non-alternating anti-runs are A345169.

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];
    Select[Range[0,100],wigQ@*stc]

A351014 Number of distinct runs in the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 07 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 number 3310 has binary expansion 110011101110 and standard composition (1,3,1,1,2,1,1,2), with runs (1), (3), (1,1), (2), (1,1), (2), of which 4 are distinct, so a(3310) = 4.
		

Crossrefs

Counting not necessarily distinct runs gives A124767.
Using binary expansions instead of standard compositions gives A297770.
Positions of first appearances are A351015.
A005811 counts runs in binary expansion.
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:
- 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.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- 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;
    Table[Length[Union[Split[stc[n]]]],{n,0,100}]

A345168 Numbers k such that the k-th composition in standard order is not alternating.

Original entry on oeis.org

3, 7, 10, 11, 14, 15, 19, 21, 23, 26, 27, 28, 29, 30, 31, 35, 36, 37, 39, 42, 43, 46, 47, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 69, 71, 73, 74, 75, 78, 79, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 99, 100, 101, 103, 104, 105, 106, 107, 110
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).

Examples

			The sequence of terms together with their binary indices begins:
     3: (1,1)          35: (4,1,1)        59: (1,1,2,1,1)
     7: (1,1,1)        36: (3,3)          60: (1,1,1,3)
    10: (2,2)          37: (3,2,1)        61: (1,1,1,2,1)
    11: (2,1,1)        39: (3,1,1,1)      62: (1,1,1,1,2)
    14: (1,1,2)        42: (2,2,2)        63: (1,1,1,1,1,1)
    15: (1,1,1,1)      43: (2,2,1,1)      67: (5,1,1)
    19: (3,1,1)        46: (2,1,1,2)      69: (4,2,1)
    21: (2,2,1)        47: (2,1,1,1,1)    71: (4,1,1,1)
    23: (2,1,1,1)      51: (1,3,1,1)      73: (3,3,1)
    26: (1,2,2)        52: (1,2,3)        74: (3,2,2)
    27: (1,2,1,1)      53: (1,2,2,1)      75: (3,2,1,1)
    28: (1,1,3)        55: (1,2,1,1,1)    78: (3,1,1,2)
    29: (1,1,2,1)      56: (1,1,4)        79: (3,1,1,1,1)
    30: (1,1,1,2)      57: (1,1,3,1)      83: (2,3,1,1)
    31: (1,1,1,1,1)    58: (1,1,2,2)      84: (2,2,3)
		

Crossrefs

The complement is A345167.
These compositions are counted by A345192.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A025047 counts alternating or wiggly compositions, directed A025048, A025049.
A344604 counts alternating compositions with twins.
A345194 counts alternating patterns (with twins: A344605).
A345164 counts alternating permutations of prime indices (with twins: A344606).
A345165 counts partitions without a alternating permutation, ranked by A345171.
A345170 counts partitions with a alternating permutation, ranked by A345172.
A348610 counts alternating ordered factorizations, complement A348613.
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Number of maximal anti-runs is A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Anti-run compositions are A333489.
- Non-anti-run compositions are A348612.

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];
    Select[Range[0,100],Not@*wigQ@*stc]

A351013 Number of integer compositions of n with all distinct runs.

Original entry on oeis.org

1, 1, 2, 4, 7, 14, 26, 48, 88, 161, 294, 512, 970, 1634, 2954, 5156, 9119, 15618, 27354, 46674, 80130, 138078, 232286, 394966, 665552, 1123231, 1869714, 3146410, 5186556, 8620936, 14324366, 23529274, 38564554, 63246744, 103578914, 167860584, 274465845
Offset: 0

Views

Author

Gus Wiseman, Feb 09 2022

Keywords

Examples

			The a(1) = 1 through a(5) = 14 compositions:
  (1)  (2)    (3)      (4)        (5)
       (1,1)  (1,2)    (1,3)      (1,4)
              (2,1)    (2,2)      (2,3)
              (1,1,1)  (3,1)      (3,2)
                       (1,1,2)    (4,1)
                       (2,1,1)    (1,1,3)
                       (1,1,1,1)  (1,2,2)
                                  (2,2,1)
                                  (3,1,1)
                                  (1,1,1,2)
                                  (1,1,2,1)
                                  (1,2,1,1)
                                  (2,1,1,1)
                                  (1,1,1,1,1)
For example, the composition c = (3,1,1,1,1,2,1,1,3,4,1,1) has runs (3), (1,1,1,1), (2), (1,1), (3), (4), (1,1), and since (3) and (1,1) both appear twice, c is not counted under a(20).
		

Crossrefs

The version for run-lengths instead of runs is A329739, normal A329740.
These compositions are ranked by A351290, complement A351291.
A000005 counts constant compositions, ranked by A272919.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A059966 counts binary Lyndon compositions, necklaces A008965, aperiodic A000740.
A116608 counts compositions by number of distinct parts.
A238130 and A238279 count compositions by number of runs.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329744 counts compositions by runs-resistance.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Split[#]&]],{n,0,10}]
  • PARI
    \\ here LahI is A111596 as row polynomials.
    LahI(n,y) = {sum(k=1, n, y^k*(-1)^(n-k)*(n!/k!)*binomial(n-1, k-1))}
    S(n) = {my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); 1 + sum(i=1, (sqrtint(8*n+1)-1)\2, polcoef(p,i,y)*LahI(i,y))}
    seq(n)={my(q=S(n)); [subst(serlaplace(p),y,1) | p<-Vec(prod(k=1, n, subst(q + O(x*x^(n\k)), x, x^k)))]} \\ Andrew Howroyd, Feb 12 2022

Extensions

Terms a(26) and beyond from Andrew Howroyd, Feb 12 2022

A175413 Those positive integers n that when written in binary, the lengths of the runs of 1 are distinct and the lengths of the runs of 0's are distinct.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 11, 12, 13, 14, 15, 16, 19, 23, 24, 25, 28, 29, 30, 31, 32, 35, 38, 39, 44, 47, 48, 49, 50, 52, 55, 56, 57, 59, 60, 61, 62, 63, 64, 67, 70, 71, 78, 79, 88, 92, 95, 96, 97, 98, 103, 104, 111, 112, 113, 114, 115, 116, 120, 121, 123, 124, 125
Offset: 1

Views

Author

Leroy Quet, May 07 2010

Keywords

Comments

A044813 contains those positive integers that when written in binary, have all run-lengths (of both 0's and 1's) distinct.
A175414 contains those positive integers in A175413 that are not in A044813. (A175414 contains those positive integers that when written in binary, at least one run of 0's is the same length as one run of 1's, even though all run of 0 are of distinct length and all runs of 1's are of distinct length.)
Also numbers whose binary expansion has all distinct runs (not necessarily run-lengths). - Gus Wiseman, Feb 21 2022

Crossrefs

Runs in binary expansion are counted by A005811, distinct A297770.
The complement is A351205.
The version for standard compositions is A351290, complement A351291.
A000120 counts binary weight.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A325545 counts compositions with distinct differences.
A333489 ranks anti-runs, complement A348612, counted by A003242.
A334028 counts distinct parts in standard compositions.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739.
- 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.

Programs

  • Maple
    q:= proc(n) uses ListTools; (l-> is(nops(l)=add(
          nops(i), i={Split(`=`, l, 1)}) +add(
          nops(i), i={Split(`=`, l, 0)})))(Bits[Split](n))
        end:
    select(q, [$1..200])[];  # Alois P. Heinz, Mar 14 2022
  • Mathematica
    f[n_] := And@@Unequal@@@Transpose[Partition[Length/@Split[IntegerDigits[n, 2]], 2, 2, {1,1}, 0]]; Select[Range[125], f] (* Ray Chandler, Oct 21 2011 *)
    Select[Range[0,100],UnsameQ@@Split[IntegerDigits[#,2]]&] (* Gus Wiseman, Feb 21 2022 *)
  • Python
    from itertools import groupby, product
    def ok(n):
        runs = [(k, len(list(g))) for k, g in groupby(bin(n)[2:])]
        return len(runs) == len(set(runs))
    print([k for k in range(1, 125) if ok(k)]) # Michael S. Branicky, Feb 22 2022

Extensions

Extended by Ray Chandler, Oct 21 2011

A333228 Numbers k such that the distinct parts of the k-th composition in standard order (A066099) are pairwise coprime, where a singleton is not considered coprime unless it is (1).

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 37, 38, 39, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80
Offset: 1

Views

Author

Gus Wiseman, May 28 2020

Keywords

Comments

First differs from A291166 in lacking 69, which corresponds to the composition (4,2,1).
We use the Mathematica definition for CoprimeQ, so a singleton is not considered coprime unless it is (1).
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.

Examples

			The sequence together with the corresponding compositions begins:
   1: (1)          21: (2,2,1)        39: (3,1,1,1)
   3: (1,1)        22: (2,1,2)        41: (2,3,1)
   5: (2,1)        23: (2,1,1,1)      43: (2,2,1,1)
   6: (1,2)        24: (1,4)          44: (2,1,3)
   7: (1,1,1)      25: (1,3,1)        45: (2,1,2,1)
   9: (3,1)        26: (1,2,2)        46: (2,1,1,2)
  11: (2,1,1)      27: (1,2,1,1)      47: (2,1,1,1,1)
  12: (1,3)        28: (1,1,3)        48: (1,5)
  13: (1,2,1)      29: (1,1,2,1)      49: (1,4,1)
  14: (1,1,2)      30: (1,1,1,2)      50: (1,3,2)
  15: (1,1,1,1)    31: (1,1,1,1,1)    51: (1,3,1,1)
  17: (4,1)        33: (5,1)          52: (1,2,3)
  18: (3,2)        35: (4,1,1)        53: (1,2,2,1)
  19: (3,1,1)      37: (3,2,1)        54: (1,2,1,2)
  20: (2,3)        38: (3,1,2)        55: (1,2,1,1,1)
		

Crossrefs

Pairwise coprime or singleton partitions are A051424.
Coprime or singleton sets are ranked by A087087.
The version for relatively prime instead of coprime appears to be A291166.
Numbers whose binary indices are pairwise coprime are A326675.
Coprime partitions are counted by A327516.
Not ignoring repeated parts gives A333227.
The complement is A335238.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Product is A124758.
- Reverse is A228351
- GCD is A326674.
- Heinz number is A333219.
- LCM is A333226.
- Number of distinct parts is A334028.

Programs

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

A374251 Irregular triangle read by rows where row n is the run-compression of the n-th composition in standard order.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 1, 2, 1, 4, 3, 1, 2, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 5, 4, 1, 3, 2, 3, 1, 2, 3, 2, 1, 2, 1, 2, 2, 1, 1, 4, 1, 3, 1, 1, 2, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 6, 5, 1, 4, 2, 4, 1, 3, 3, 2, 1, 3, 1, 2, 3, 1, 2, 4, 2, 3, 1, 2, 2, 1, 2, 1, 3
Offset: 1

Views

Author

Gus Wiseman, Jul 09 2024

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.
We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The standard compositions and their run-compressions begin:
   0: ()        --> ()
   1: (1)       --> (1)
   2: (2)       --> (2)
   3: (1,1)     --> (1)
   4: (3)       --> (3)
   5: (2,1)     --> (2,1)
   6: (1,2)     --> (1,2)
   7: (1,1,1)   --> (1)
   8: (4)       --> (4)
   9: (3,1)     --> (3,1)
  10: (2,2)     --> (2)
  11: (2,1,1)   --> (2,1)
  12: (1,3)     --> (1,3)
  13: (1,2,1)   --> (1,2,1)
  14: (1,1,2)   --> (1,2)
  15: (1,1,1,1) --> (1)
		

Crossrefs

Last column is A001511.
First column is A065120.
Row-lengths are A124767.
Using prime indices we get A304038, row-sums A066328.
Row n has A334028(n) distinct elements.
Rows are ranked by A373948 (standard order).
Row-sums are A373953.
A003242 counts run-compressed compositions, i.e., anti-runs, ranks A333489.
A007947 (squarefree kernel) represents run-compression of multisets.
A037201 run-compresses first differences of primes, halved A373947.
A066099 lists the parts of compositions in standard order.
A116861 counts partitions by sum of run-compression.
A238279 and A333755 count compositions by number of runs.
A373949 counts compositions by sum of run-compression, opposite A373951.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[First/@Split[stc[n]],{n,100}]

A353849 Number of distinct positive run-sums of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 30 2022

Keywords

Comments

Every sequence can be uniquely split into a sequence of non-overlapping runs. For example, the runs of (2,2,1,1,1,3,2,2) are ((2,2),(1,1,1),(3),(2,2)), with sums (4,3,3,4).
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.

Examples

			Composition 462903 in standard order is (1,1,4,7,1,2,1,1,1), with run-sums (2,4,7,1,2,3), of which a(462903) = 5 are distinct.
		

Crossrefs

Counting repeated runs also gives A124767.
Positions of first appearances are A246534.
For distinct runs instead of run-sums we have A351014 (firsts A351015).
A version for partitions is A353835, weak A353861.
Positions of 1's are A353848, counted by A353851.
The version for binary expansion is A353929 (firsts A353930).
The run-sums themselves are listed by A353932, with A353849 distinct terms.
For distinct run-lengths instead of run-sums we have A354579.
A005811 counts runs in binary expansion.
A066099 lists compositions in standard order.
A165413 counts distinct run-lengths in binary expansion.
A297770 counts distinct runs in binary expansion, firsts A350952.
A353847 represents the run-sum transformation for compositions.
A353853-A353859 pertain to composition run-sum trajectory.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- 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;
    Table[Length[Union[Total/@Split[stc[n]]]],{n,0,100}]

A062880 Zero together with the numbers which can be written as a sum of distinct odd powers of 2.

Original entry on oeis.org

0, 2, 8, 10, 32, 34, 40, 42, 128, 130, 136, 138, 160, 162, 168, 170, 512, 514, 520, 522, 544, 546, 552, 554, 640, 642, 648, 650, 672, 674, 680, 682, 2048, 2050, 2056, 2058, 2080, 2082, 2088, 2090, 2176, 2178, 2184, 2186, 2208, 2210, 2216, 2218, 2560, 2562
Offset: 0

Views

Author

Antti Karttunen, Jun 26 2001

Keywords

Comments

Binary expansion of n does not contain 1-bits at even positions.
Integers whose base-4 representation consists of only 0's and 2's.
Every nonnegative even number is a unique sum of the form a(k)+2*a(l); moreover, this sequence is unique with such property. - Vladimir Shevelev, Nov 07 2008
Also numbers such that the digital sum base 2 and the digital sum base 4 are in a ratio of 2:4. - Michel Marcus, Sep 23 2013
From Gus Wiseman, Jun 10 2020: (Start)
Numbers k such that the k-th composition in standard order has all even parts. 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. For example, the sequence of all compositions into even parts begins:
0: () 520: (6,4) 2080: (6,6)
2: (2) 522: (6,2,2) 2082: (6,4,2)
8: (4) 544: (4,6) 2088: (6,2,4)
10: (2,2) 546: (4,4,2) 2090: (6,2,2,2)
32: (6) 552: (4,2,4) 2176: (4,8)
34: (4,2) 554: (4,2,2,2) 2178: (4,6,2)
40: (2,4) 640: (2,8) 2184: (4,4,4)
42: (2,2,2) 642: (2,6,2) 2186: (4,4,2,2)
128: (8) 648: (2,4,4) 2208: (4,2,6)
130: (6,2) 650: (2,4,2,2) 2210: (4,2,4,2)
136: (4,4) 672: (2,2,6) 2216: (4,2,2,4)
138: (4,2,2) 674: (2,2,4,2) 2218: (4,2,2,2,2)
160: (2,6) 680: (2,2,2,4) 2560: (2,10)
162: (2,4,2) 682: (2,2,2,2,2) 2562: (2,8,2)
168: (2,2,4) 2048: (12) 2568: (2,6,4)
170: (2,2,2,2) 2050: (10,2) 2570: (2,6,2,2)
512: (10) 2056: (8,4) 2592: (2,4,6)
514: (8,2) 2058: (8,2,2) 2594: (2,4,4,2)
(End)

Crossrefs

Cf. A000695.
Except for first term, n such that A063694(n) = 0. Binary expansion is given in A062033.
Interpreted as Zeckendorf expansion: A062879.
Central diagonal of arrays A163357 and A163359.
Even partitions are counted by A035363.
Numbers with an even number of 1's in binary expansion are A001969.
Numbers whose binary expansion has even length are A053754.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without even parts are A060142.
- Sum is A070939.
- Product is A124758.
- Strict compositions are A233564.
- Heinz number is A333219.
- Number of distinct parts is A334028.

Programs

  • C
    uint32_t a_next(uint32_t a_n) { return (a_n + 0x55555556) & 0xaaaaaaaa; } /* Falk Hüffner, Jan 22 2022 */
    
  • Haskell
    a062880 n = a062880_list !! n
    a062880_list = filter f [0..] where
       f 0 = True
       f x = (m == 0 || m == 2) && f x'  where (x', m) = divMod x 4
    -- Reinhard Zumkeller, Nov 20 2012
    
  • Maple
    [seq(a(j),j=0..100)]; a := n -> add((floor(n/(2^i)) mod 2)*(2^((2*i)+1)),i=0..floor_log_2(n+1));
  • Mathematica
    b[n_] := BitAnd[n, Sum[2^k, {k, 0, Log[2, n] // Floor, 2}]]; Select[Range[ 0, 10^4], b[#] == 0&] (* Jean-François Alcover, Feb 28 2016 *)
  • Python
    def A062880(n): return int(bin(n)[2:],4)<<1 # Chai Wah Wu, Aug 21 2023

Formula

a(n) = 2 * A000695(n). - Vladimir Shevelev, Nov 07 2008
From Robert Israel, Apr 10 2018: (Start)
a(2*n) = 4*a(n).
a(2*n+1) = 4*a(n)+2.
G.f. g(x) satisfies: g(x) = 4*(1+x)*g(x^2)+2*x/(1-x^2). (End)

A351017 Number of binary words of length n with all distinct run-lengths.

Original entry on oeis.org

1, 2, 2, 6, 6, 10, 22, 26, 38, 54, 114, 130, 202, 266, 386, 702, 870, 1234, 1702, 2354, 3110, 5502, 6594, 9514, 12586, 17522, 22610, 31206, 48630, 60922, 83734, 111482, 149750, 196086, 261618, 336850, 514810, 631946, 862130, 1116654, 1502982, 1916530, 2555734, 3242546
Offset: 0

Views

Author

Gus Wiseman, Feb 07 2022

Keywords

Examples

			The a(0) = 1 through a(6) = 22 words:
  {}  0   00   000   0000   00000   000000
      1   11   001   0001   00001   000001
               011   0111   00011   000011
               100   1000   00111   000100
               110   1110   01111   000110
               111   1111   10000   001000
                            11000   001110
                            11100   001111
                            11110   011000
                            11111   011100
                                    011111
                                    100000
                                    100011
                                    100111
                                    110000
                                    110001
                                    110111
                                    111001
                                    111011
                                    111100
                                    111110
                                    111111
		

Crossrefs

Using binary expansions instead of words gives A032020, ranked by A044813.
The version for partitions is A098859.
The complement is counted by twice A261982.
The version for compositions is A329739, for runs A351013.
For runs instead of run-lengths we have A351016, twice A351018.
The version for patterns is A351292, for runs A351200.
A000120 counts binary weight.
A001037 counts binary Lyndon words, necklaces A000031, aperiodic A027375.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329767 counts binary words by runs-resistance.
A351014 counts distinct runs in standard compositions.
A351204 counts partitions where every permutation has all distinct runs.
A351290 ranks compositions with all distinct runs.

Programs

  • Mathematica
    Table[Length[Select[Tuples[{0,1},n],UnsameQ@@Length/@Split[#]&]],{n,0,10}]
  • Python
    from itertools import groupby, product
    def adrl(s):
        runlens = [len(list(g)) for k, g in groupby(s)]
        return len(runlens) == len(set(runlens))
    def a(n):
        if n == 0: return 1
        return 2*sum(adrl("1"+"".join(w)) for w in product("01", repeat=n-1))
    print([a(n) for n in range(20)]) # Michael S. Branicky, Feb 08 2022

Formula

a(n>0) = 2 * A032020(n).

Extensions

a(25)-a(32) from Michael S. Branicky, Feb 08 2022
More terms from David A. Corneth, Feb 08 2022 using data from A032020
Showing 1-10 of 40 results. Next