OFFSET
1,3
COMMENTS
Note the indexing: domain starts from one, while the range includes also zero. See also comments in A253564.
The a(n)-th composition in standard order (graded reverse-lexicographic, A066099) is one plus the first differences of the weakly increasing sequence of prime indices of n with 1 prepended. See formula for a simplification. The triangular form is A358169. The inverse is A253565. Not prepending 1 gives A358171. For Heinz numbers instead of standard compositions we have A325351 (without prepending A325352). - Gus Wiseman, Dec 23 2022
LINKS
FORMULA
As a composition of other permutations:
If 2n = Product_{i=1..k} prime(x_i) then a(n) = Sum_{i=1..k-1} 2^(x_k-x_{k-i}+i-1). - Gus Wiseman, Dec 23 2022
EXAMPLE
From Gus Wiseman, Dec 23 2022: (Start)
This represents the following bijection between partitions and compositions. The reversed prime indices of n together with the a(n)-th composition in standard order are:
1: () -> ()
2: (1) -> (1)
3: (2) -> (2)
4: (1,1) -> (1,1)
5: (3) -> (3)
6: (2,1) -> (1,2)
7: (4) -> (4)
8: (1,1,1) -> (1,1,1)
9: (2,2) -> (2,1)
10: (3,1) -> (1,3)
11: (5) -> (5)
12: (2,1,1) -> (1,1,2)
13: (6) -> (6)
14: (4,1) -> (1,4)
15: (3,2) -> (2,2)
16: (1,1,1,1) -> (1,1,1,1)
(End)
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
stcinv/@Table[Differences[Prepend[primeMS[n], 1]]+1, {n, 100}] (* Gus Wiseman, Dec 23 2022 *)
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 03 2015
STATUS
approved