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

A233249 a(1)=0; for k >= 1, let prime(k) map to 10...0 with k-1 zeros and let prime(k)*prime(m) map to the concatenation in binary of 2^(k-1) and 2^(m-1). For n >= 2, let the prime power factorization of n be mapped to r(n). a(n) is the term in A114994 which is c-equivalent to r(n) (see there our comment).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 7, 10, 9, 16, 11, 32, 17, 18, 15, 64, 21, 128, 19, 34, 33, 256, 23, 36, 65, 42, 35, 512, 37, 1024, 31, 66, 129, 68, 43, 2048, 257, 130, 39, 4096, 69, 8192, 67, 74, 513, 16384, 47, 136, 73, 258, 131, 32768, 85, 132, 71, 514, 1025, 65536, 75
Offset: 1

Views

Author

Vladimir Shevelev, Dec 06 2013

Keywords

Comments

Let (10...0)_i (i>=0) denote 2^i in binary. Under (10...0)_i^k we understand a concatenation of (10...0)_i k times.
If n=Product_{i=1..m} p_i^t_i is the prime power factorization of n, then in the name r(n)=concatenation{i=1..m} ((10...0_(i-1)^t_i).
Numbers q and s are called c-equivalent if their binary expansions contain the same set of parts of the form 10...0. For example, 14=(1)(1)(10)~(10)(1)(1)=11.
Conversely, if n~n_1 such that n_1 is in A114994 and has c-factorization: n_1 = concatenation{i=m,...,0} ((10...0)i^t_i), one can consider "converse" sequence {s(n)}, where s(n) = Product{i=m..0} p_(i+1)^t_i.
For example, for n=22, n_1=21=((10)^2)(1), and s(22)=3^2*2=18.
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 binary expansion of k, prepending 0, taking first differences, and reversing again. Then a(n) is the number k such that the k-th composition in standard order consists of the prime indices of n in weakly decreasing order (the partition with Heinz number n). - Gus Wiseman, Apr 02 2020

Examples

			n=10=2*5 is mapped to (1)(100)~(100)(1). Since 9 is in A114994, then a(10)=9.
From _Gus Wiseman_, Apr 02 2020: (Start)
The sequence together with the corresponding compositions begins:
   0: ()             128: (8)             2048: (12)
   1: (1)             19: (3,1,1)          257: (8,1)
   2: (2)             34: (4,2)            130: (6,2)
   3: (1,1)           33: (5,1)             39: (3,1,1,1)
   4: (3)            256: (9)             4096: (13)
   5: (2,1)           23: (2,1,1,1)         69: (4,2,1)
   8: (4)             36: (3,3)           8192: (14)
   7: (1,1,1)         65: (6,1)             67: (5,1,1)
  10: (2,2)           42: (2,2,2)           74: (3,2,2)
   9: (3,1)           35: (4,1,1)          513: (9,1)
  16: (5)            512: (10)           16384: (15)
  11: (2,1,1)         37: (3,2,1)           47: (2,1,1,1,1)
  32: (6)           1024: (11)             136: (4,4)
  17: (4,1)           31: (1,1,1,1,1)       73: (3,3,1)
  18: (3,2)           66: (5,2)            258: (7,2)
  15: (1,1,1,1)      129: (7,1)            131: (6,1,1)
  64: (7)             68: (4,3)          32768: (16)
  21: (2,2,1)         43: (2,2,1,1)         85: (2,2,2,1)
For example, the Heinz number of (2,2,1) is 18, and the 21st composition in standard order is (2,2,1), so a(18) = 21.
(End)
		

Crossrefs

The sorted version is A114994.
The primorials A002110 map to A246534.
A partial inverse is A333219.
The reversed version is A333220.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[2^Accumulate[primeMS[n]]]/2,{n,100}] (* Gus Wiseman, Apr 02 2020 *)

Formula

A059893(a(n)) = A333220(n). A124767(a(n)) = A001221(n). - Gus Wiseman, Apr 02 2020

Extensions

More terms from Peter J. C. Moses, Dec 07 2013

A233312 Terms of A114994 which are c-equivalent to "c-squares" (A020330).

Original entry on oeis.org

0, 3, 10, 15, 36, 43, 43, 63, 136, 147, 170, 175, 147, 175, 175, 255, 528, 547, 586, 591, 586, 683, 683, 703, 547, 591, 683, 703, 591, 703, 703, 1023, 2080, 2115, 2186, 2191, 2340, 2347, 2347, 2367, 2186, 2347, 2730, 2735, 2347, 2735, 2735, 2815, 2115, 2191
Offset: 0

Views

Author

Vladimir Shevelev, Dec 07 2013

Keywords

Comments

About c-equivalent see in comment in A233249.
a(n) is even iff A171791(n+1) is odd - holds for at least the first 1028 terms. The reason, put very briefly, is that: a(n) is even if and only if n is the double of a "fibbinary number". Cf. A267508. [Jörgen Backelin, Jan 15 2016 added by Jeremy Gardiner, Jan 26 2016]

Examples

			c-square of 5 in binary is (10)(1)(10)(1)~(10)(10)(1)(1) which is 43 in decimal. So a(5)=43.
		

Crossrefs

Extensions

More terms from Peter J. C. Moses, Dec 07 2013

A173871 Row sums of A114994.

Original entry on oeis.org

0, 1, 5, 16, 53, 145, 441, 1165, 3325, 8840, 24268, 63542, 172420, 446485, 1182329, 3055461, 7966038, 20351233, 52507157, 133014971, 339170500, 853849745, 2154442760, 5382418592, 13481157491, 33449252747, 83091028844, 205013093570, 505799029994, 1240477207822, 3042433058325
Offset: 0

Views

Author

Alford Arnold, Mar 05 2010

Keywords

Examples

			A114994 begins:
0;
1; => row sum 1;
2,3; => row sum 5;
4,5,7; => row sum 16;
8,9,10,11,15; => row sum 53.
		

Crossrefs

Programs

  • Maple
    isA114994aux := proc(n) local k; for k from 0 do fk1 := 4^(k+1) ; if 2^k mod fk1 = n mod fk1 then return true; elif (2^k mod fk1) > n then return false; end if; end do: end proc:
    isA114994 := proc(n) option remember ; if n = 0 then return true; elif type(n,'odd') then if n <= 11 then true; else return procname((n-1)/2) ; fi; else return ( isA114994(n/2) and isA114994aux(n/2) ); end if; end proc:
    A173871 := proc(n) a := 0 ; for k from 2^n to 2^(n+1)-1 do if isA114994(k) then a := a+k; end if; end do; a ; end proc:
    seq(A173871(n),n=0..19) ; # R. J. Mathar, Mar 26 2010

Extensions

a(9)-a(19) from R. J. Mathar, Mar 26 2010
a(0) prepended by and more terms from Jinyuan Wang, Feb 23 2020

A176577 Create a table by linearizing and concatenating arrays embedded in A114994 the terms of which map to numeric partitions.

Original entry on oeis.org

1, 2, 10, 3, 18, 36, 4, 21, 68, 42, 5, 34, 73, 74, 136, 7, 37, 132, 85, 264, 146, 8, 43, 137, 138, 273, 274, 170, 9, 66, 147, 149, 520, 293, 298, 292, 11, 69, 260, 171, 529, 530, 341, 548, 528, 15, 75, 265, 266, 547, 549, 554, 585, 1040, 546, 16, 87, 275, 277, 1032, 587
Offset: 1

Views

Author

Alford Arnold, Apr 20 2010

Keywords

Examples

			The first embedded array is sequence A099629 = 1 2 3 4 5 7 8 9 11 15 ...
The second array begins 10 18 21 34 37 43 ...
and the table begins
1..10..36..42..136..146..170..292...
2..18..68..74..
3..21..73..85..
4..34..
5..37..
7..43..
The number 292 in binary is 100100100
which maps to partition 3+3+3.
		

Crossrefs

A167979 (a similar array also mapped to numeric partitions) [From Alford Arnold, May 04 2010]

Extensions

More terms from Alford Arnold, May 04 2010

A173870 Consider each term k contained in A114994; write 2k if and only if 2k is not a member of A114994.

Original entry on oeis.org

6, 14, 20, 22, 30, 38, 46, 62, 70, 72, 78, 84, 86, 94, 126, 134, 142, 148, 150, 158, 174, 190, 254, 262, 270, 272, 276, 278, 286, 294, 302, 318, 340, 342, 350, 382, 510, 518, 526, 532, 534, 542, 550, 558, 574, 584, 590, 596, 598, 606, 638, 686, 702, 766, 1022
Offset: 0

Views

Author

Alford Arnold, Mar 01 2010

Keywords

Comments

Recall that A114994 can be regarded as a table with row lengths A000041(n).
Likewise, a(n) has row lengths 0,1,1,3,3,7,8,14,18,28,35,53,67,... which appears to coincide with sequence A117989.
The row lengths also match 1 2 3 5 7 11 15 22 ... minus 1 1 2 2 4 4 7 8 ... - Alford Arnold, Mar 30 2010

Examples

			Row three of A114994 is 4,5,7 when doubled becomes 8,10,14.
8 and 10 are in A114994 so not in a(n); 14 is not in A114994 so is in a(n).
		

Crossrefs

Cf. A000041 A114994 A117989 (A125106, A126441, A161924)(3 closely related sequences).
Cf. A002865 [From Alford Arnold, Mar 30 2010]

A233568 a(n) is number in A114994 which c-equivalent to c-factorial of n (A047778).

Original entry on oeis.org

1, 5, 23, 151, 1199, 9567, 76543, 1125119, 17978879, 287659519, 4602550271, 73629609983, 1178073743359, 18849179828223, 301586877251583, 9308786131992575, 297840749160955903, 9530903606625042431, 304988913945966280703, 9759645240406772285439
Offset: 1

Views

Author

Vladimir Shevelev, Dec 13 2013

Keywords

Comments

Two numbers n_1 and n_2 are called c-equivalent (n_1~n_2) if in binary they have the same parts of the form 10...0 with k>=0 zeros up to a permutation of them. For example, 6~5, 14~13~11, 12~9.

Examples

			A047778(4)=220 which has parts (1)(10)(1)(1)(100)~(100)(10)(1)(1)(1) which is 151 in decimal. So, a(4)=151.
		

Programs

  • Mathematica
    bitPatt[n_]:=bitPatt[n]=Split[IntegerDigits[n,2],#1>#2||#2==0&];Map[FromDigits[Flatten[Reverse[Sort[bitPatt[FromDigits[Flatten[Map[IntegerDigits[#,2]&,Range[#]]],2]]]]],2]&,Range[20]] (* Peter J. C. Moses, Dec 14 2013 *)

A124767 Number of level runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
For n > 0, a(n) is one more than the number of adjacent unequal terms in the n-th composition in standard order. Also the number of runs in the same composition. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the level runs are 2; 1,1; so a(11) = 2.
The table starts:
  0
  1
  1 1
  1 2 2 1
  1 2 1 2 2 3 2 1
  1 2 2 2 2 2 3 2 2 3 2 3 2 3 2 1
  1 2 2 2 1 3 3 2 2 3 1 2 3 4 3 2 2 3 3 3 3 3 4 3 2 3 2 3 2 3 2 1
The 1234567th composition in standard order is (3,2,1,2,2,1,2,5,1,1,1) with runs ((3),(2),(1),(2,2),(1),(2),(5),(1,1,1)), so a(1234567) = 8. - _Gus Wiseman_, Apr 08 2020
		

Crossrefs

Row-lengths are A011782.
Compositions counted by number of runs are A238279 or A333755.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767 (this sequence).
- Weakly increasing compositions are A225620.
- Strict compositions A233564.
- Constant compositions are A272919.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Run-lengths are A333769 (triangle).

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Split[stc[n]]],{n,0,100}] (* Gus Wiseman, Apr 17 2020 *)

Formula

a(0) = 0, a(n) = 1 + Sum_{1<=i=1 0.
For n > 0, a(n) = A333382(n) + 1. - Gus Wiseman, Apr 08 2020

A233564 c-squarefree numbers: positive integers which in binary are concatenation of distinct parts of the form 10...0 with nonnegative number of zeros.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 16, 17, 18, 20, 24, 32, 33, 34, 37, 38, 40, 41, 44, 48, 50, 52, 64, 65, 66, 68, 69, 70, 72, 80, 81, 88, 96, 98, 104, 128, 129, 130, 132, 133, 134, 137, 140, 144, 145, 152, 160, 161, 176, 192, 194, 196, 200, 208, 256, 257, 258, 260, 261
Offset: 1

Views

Author

Vladimir Shevelev, Dec 13 2013

Keywords

Comments

Number of terms in interval [2^(n-1), 2^n) is the number of compositions of n with distinct parts (cf. A032020). For example, if n=6, then interval [2^5, 2^6) contains 11 terms {32,...,52}. This corresponds to 11 compositions with distinct parts of 6: 6, 5+1, 1+5, 4+2, 2+4, 3+2+1, 3+1+2, 2+3+1, 2+1+3, 1+3+2, 1+2+3.
From Gus Wiseman, Apr 06 2020: (Start)
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. This sequence lists all numbers k such that the k-th composition in standard order is strict. For example, the sequence together with the corresponding strict compositions begins:
0: () 38: (3,1,2) 98: (1,4,2)
1: (1) 40: (2,4) 104: (1,2,4)
2: (2) 41: (2,3,1) 128: (8)
4: (3) 44: (2,1,3) 129: (7,1)
5: (2,1) 48: (1,5) 130: (6,2)
6: (1,2) 50: (1,3,2) 132: (5,3)
8: (4) 52: (1,2,3) 133: (5,2,1)
9: (3,1) 64: (7) 134: (5,1,2)
12: (1,3) 65: (6,1) 137: (4,3,1)
16: (5) 66: (5,2) 140: (4,1,3)
17: (4,1) 68: (4,3) 144: (3,5)
18: (3,2) 69: (4,2,1) 145: (3,4,1)
20: (2,3) 70: (4,1,2) 152: (3,1,4)
24: (1,4) 72: (3,4) 160: (2,6)
32: (6) 80: (2,5) 161: (2,5,1)
33: (5,1) 81: (2,4,1) 176: (2,1,5)
34: (4,2) 88: (2,1,4) 192: (1,7)
37: (3,2,1) 96: (1,6) 194: (1,5,2)
(End)

Examples

			49 in binary has the following parts of the form 10...0 with nonnegative number of  zeros: (1),(1000),(1). Two of them are the same. So it is not in the sequence. On the other hand, 50 has distinct parts (1)(100)(10), thus it is a term.
		

Crossrefs

A subset of A333489 and superset of A333218.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Weighted sum is A029931.
- Partial sums from the right are A048793.
- Sum is A070939.
- Runs are counted by A124767.
- Reversed initial intervals A164894.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are counted by A333381.
- Anti-runs are A333489.

Programs

  • Mathematica
    bitPatt[n_]:=bitPatt[n]=Split[IntegerDigits[n,2],#1>#2||#2==0&];
    Select[Range[0,300],bitPatt[#]==DeleteDuplicates[bitPatt[#]]&] (* Peter J. C. Moses, Dec 13 2013 *)
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@stc[#]&] (* Gus Wiseman, Apr 04 2020 *)

Extensions

More terms from Peter J. C. Moses, Dec 13 2013
0 prepended by Gus Wiseman, Apr 04 2020

A228351 Triangle read by rows in which row n lists the compositions (ordered partitions) of n (see Comments lines for definition).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 30 2013

Keywords

Comments

The representation of the compositions (for fixed n) is as lists of parts, the order between individual compositions (for the same n) is (list-)reversed co-lexicographic. - Joerg Arndt, Sep 02 2013
Dropping the "(list-)reversed" in the comment above gives A228525.
The equivalent sequence for partitions is A026792.
This sequence lists (without repetitions) all finite compositions, in such a way that, if [P_1, ..., P_r] denotes the composition occupying the n-th position in the list, then (((2*n/2^(P_1)-1)/2^(P_2)-1)/...)/2^(P_r)-1 = 0. - Lorenzo Sauras Altuzarra, Jan 22 2020
The k-th composition in the list is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, and taking first differences. Reversing again gives A066099, which is described as the standard ordering. Both sequences define a bijective correspondence between nonnegative integers and integer compositions. - Gus Wiseman, Apr 01 2020
It follows from the previous comment that A000120(k) is the length of the k-th composition that is listed by this sequence (recall that A000120(k) is the number of 1's in the binary expansion of k). - Lorenzo Sauras Altuzarra, Sep 29 2020

Examples

			Illustration of initial terms:
-----------------------------------
n  j     Diagram     Composition j
-----------------------------------
.         _
1  1     |_|         1;
.         _ _
2  1     |_  |       2,
2  2     |_|_|       1, 1;
.         _ _ _
3  1     |_    |     3,
3  2     |_|_  |     1, 2,
3  3     |_  | |     2, 1,
3  4     |_|_|_|     1, 1, 1;
.         _ _ _ _
4  1     |_      |   4,
4  2     |_|_    |   1, 3,
4  3     |_  |   |   2, 2,
4  4     |_|_|_  |   1, 1, 2,
4  5     |_    | |   3, 1,
4  6     |_|_  | |   1, 2, 1,
4  7     |_  | | |   2, 1, 1,
4  8     |_|_|_|_|   1, 1, 1, 1;
.
Triangle begins:
[1];
[2],[1,1];
[3],[1,2],[2,1],[1,1,1];
[4],[1,3],[2,2],[1,1,2],[3,1],[1,2,1],[2,1,1],[1,1,1,1];
[5],[1,4],[2,3],[1,1,3],[3,2],[1,2,2],[2,1,2],[1,1,1,2],[4,1],[1,3,1],[2,2,1],[1,1,2,1],[3,1,1],[1,2,1,1],[2,1,1,1],[1,1,1,1,1];
...
For example [1,2] occupies the 5th position in the corresponding list of compositions and indeed (2*5/2^1-1)/2^2-1 = 0. - _Lorenzo Sauras Altuzarra_, Jan 22 2020
12 --binary expansion--> [1,1,0,0] --reverse--> [0,0,1,1] --positions of 1's--> [3,4] --prepend 0--> [0,3,4] --first differences--> [3,1]. - _Lorenzo Sauras Altuzarra_, Sep 29 2020
		

Crossrefs

Row n has length A001792(n-1). Row sums give A001787, n >= 1.
Cf. A000120 (binary weight), A001511, A006519, A011782, A026792, A065120.
A related ranking of finite sets is A048793/A272020.
All of the following consider the k-th row to be the k-th composition, ignoring the coarser grouping by sum.
- Indices of weakly increasing rows are A114994.
- Indices of weakly decreasing rows are A225620.
- Indices of strictly decreasing rows are A333255.
- Indices of strictly increasing rows are A333256.
- Indices of reversed interval rows A164894.
- Indices of interval rows are A246534.
- Indices of strict rows are A233564.
- Indices of constant rows are A272919.
- Indices of anti-run rows are A333489.
- Row k has A124767(k) runs and A333381(k) anti-runs.
- Row k has GCD A326674(k) and LCM A333226(k).
- Row k has Heinz number A333219(k).
Equals A163510+1, termwise.
Cf. A124734 (increasing length, then lexicographic).
Cf. A296774 (increasing length, then reverse lexicographic).
Cf. A337243 (increasing length, then colexicographic).
Cf. A337259 (increasing length, then reverse colexicographic).
Cf. A296773 (decreasing length, then lexicographic).
Cf. A296772 (decreasing length, then reverse lexicographic).
Cf. A337260 (decreasing length, then colexicographic).
Cf. A108244 (decreasing length, then reverse colexicographic).
Cf. A228369 (lexicographic).
Cf. A066099 (reverse lexicographic).
Cf. A228525 (colexicographic).

Programs

  • Haskell
    a228351 n = a228351_list !! (n - 1)
    a228351_list = concatMap a228351_row [1..]
    a228351_row 0 = []
    a228351_row n = a001511 n : a228351_row (n `div` 2^(a001511 n))
    -- Peter Kagey, Jun 27 2016
    
  • Maple
    # Program computing the sequence:
    A228351 := proc(n) local c, k, L, N: L, N := [], [seq(2*r, r = 1 .. n)]: for k in N do c := 0: while k != 0 do if gcd(k, 2) = 2 then k := k/2: c := c+1: else L := [op(L), op(c)]: k := k-1: c := 0: fi: od: od: L[n]: end: # Lorenzo Sauras Altuzarra, Jan 22 2020
    # Program computing the list of compositions:
    List := proc(n) local c, k, L, M, N: L, M, N := [], [], [seq(2*r, r = 1 .. 2^n-1)]: for k in N do c := 0: while k != 0 do if gcd(k, 2) = 2 then k := k/2: c := c+1: else L := [op(L), c]: k := k-1: c := 0: fi: od: M := [op(M), L]: L := []: od: M: end: # Lorenzo Sauras Altuzarra, Jan 22 2020
  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Differences[Prepend[bpe[n],0]],{n,0,30}] (* Gus Wiseman, Apr 01 2020 *)
  • Python
    from itertools import count, islice
    def A228351_gen(): # generator of terms
        for n in count(1):
            k = n
            while k:
                yield (s:=(~k&k-1).bit_length()+1)
                k >>= s
    A228351_list = list(islice(A228351_gen(),30)) # Chai Wah Wu, Jul 17 2023

A333381 Number of maximal anti-runs of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 24 2020

Keywords

Comments

Anti-runs are sequences without any adjacent equal terms.
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 n > 0, also one plus the number of adjacent equal pairs in the n-th composition in standard order.

Examples

			The 46th composition in standard order is (2,1,1,2), with maximal anti-runs ((2,1),(1,2)), so a(46) = 2.
		

Crossrefs

Anti-runs summing to n are counted by A003242(n).
A triangle counting maximal anti-runs of compositions is A106356.
A triangle counting maximal runs of compositions is A238279.
Partitions whose first differences are an anti-run are A238424.
All of the following pertain to compositions in standard order (A066099):
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Strict compositions are ranked by A233564.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Adjacent unequal pairs are counted by A333382.
- Anti-runs are ranked by A333489.

Programs

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

Formula

For n > 0, a(n) = A124762(n) + 1.
Showing 1-10 of 112 results. Next