A066099 Triangle read by rows, in which row n lists the compositions of n in reverse lexicographic order.
1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 3, 1, 2, 2, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 5, 4, 1, 3, 2, 3, 1, 1, 2, 3, 2, 2, 1, 2, 1, 2, 2, 1, 1, 1, 1, 4, 1, 3, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 6, 5, 1, 4, 2, 4, 1, 1, 3, 3, 3, 2, 1, 3, 1, 2, 3, 1, 1, 1, 2, 4, 2, 3
Offset: 1
Examples
A057335 begins 1 2 4 6 8 12 18 30 16 24 36 ... so we can write 1 2 1 3 2 1 1 4 3 2 2 1 1 1 1 ... . . 1 . 1 2 1 . 1 2 1 3 2 1 1 ... . . . . . . 1 . . . 1 . 1 2 1 ... . . . . . . . . . . . . . . 1 ... and the columns here gives the rows of the triangle, which begins 1 2; 1 1 3; 2 1; 1 2; 1 1 1 4; 3 1; 2 2; 2 1 1; 1 3; 1 2 1; 1 1 2; 1 1 1 1 ... From _Omar E. Pol_, Sep 03 2013: (Start) Illustration of initial terms: ----------------------------------- n j Diagram Composition j ----------------------------------- . _ 1 1 |_| 1; . _ _ 2 1 | _| 2, 2 2 |_|_| 1, 1; . _ _ _ 3 1 | _| 3, 3 2 | _|_| 2, 1, 3 3 | | _| 1, 2, 3 4 |_|_|_| 1, 1, 1; . _ _ _ _ 4 1 | _| 4, 4 2 | _|_| 3, 1, 4 3 | | _| 2, 2, 4 4 | _|_|_| 2, 1, 1, 4 5 | | _| 1, 3, 4 6 | | _|_| 1, 2, 1, 4 7 | | | _| 1, 1, 2, 4 8 |_|_|_|_| 1, 1, 1, 1; (End)
Links
- Franklin T. Adams-Watters, Table of n, a(n) for n = 1..5120 (through compositions of 10)
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
- Gus Wiseman, Statistics, classes, and transformations of standard compositions
Crossrefs
Lists of compositions of integers: this sequence (reverse lexicographic order; minus one gives A108730), A228351 (reverse colexicographic order - every composition is reversed; minus one gives A163510), A228369 (lexicographic), A228525 (colexicographic), A124734 (length, then lexicographic; minus one gives A124735), A296774 (length, then reverse lexicographic), A337243 (length, then colexicographic), A337259 (length, then reverse colexicographic), A296773 (decreasing length, then lexicographic), A296772 (decreasing length, then reverse lexicographic), A337260 (decreasing length, then colexicographic), A108244 (decreasing length, then reverse colexicographic), also A101211 and A227736 (run lengths of bits).
Cf. lists of partitions of integers, or multisets of integers: A026791 and crosserfs therein, A112798 and crossrefs therein.
See link for additional crossrefs pertaining to standard compositions.
Programs
-
Haskell
a066099 = (!!) a066099_list a066099_list = concat a066099_tabf a066099_tabf = map a066099_row [1..] a066099_row n = reverse $ a228351_row n -- (each composition as a row) -- Peter Kagey, Aug 25 2016
-
Mathematica
Table[FactorInteger[Apply[Times, Map[Prime, Accumulate @ IntegerDigits[n, 2]]]][[All, -1]], {n, 41}] // Flatten (* Michael De Vlieger, Jul 11 2017 *) stc[n_] := Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]] // Reverse; Table[stc[n], {n, 0, 20}] // Flatten (* Gus Wiseman, May 19 2020 *) Table[Reverse @ LexicographicSort @ Flatten[Permutations /@ Partitions[n], 1], {n, 10}] // Flatten (* Eric W. Weisstein, Jun 26 2023 *)
-
PARI
arow(n) = {local(v=vector(n),j=0,k=0); while(n>0,k++; if(n%2==1,v[j++]=k;k=0);n\=2); vector(j,i,v[j-i+1])} \\ returns empty for n=0. - Franklin T. Adams-Watters, Apr 02 2014
-
Python
from itertools import islice from itertools import accumulate, count, groupby, islice def A066099_gen(): for i in count(1): yield [len(list(g)) for _,g in groupby(accumulate(int(b) for b in bin(i)[2:]))] A066099 = list(islice(A066099_gen(), 120)) # Jwalin Bhatt, Feb 28 2025
-
Sage
def a_row(n): return list(reversed(Compositions(n))) flatten([a_row(n) for n in range(1,6)]) # Peter Luschny, May 19 2018
Formula
Extensions
Edited with additional terms by Franklin T. Adams-Watters, Nov 06 2006
0th row removed by Andrey Zabolotskiy, May 19 2018
Comments