A253566 Permutation of natural numbers: a(n) = A243071(A122111(n)).
0, 1, 2, 3, 4, 6, 8, 7, 5, 12, 16, 14, 32, 24, 10, 15, 64, 13, 128, 28, 20, 48, 256, 30, 9, 96, 11, 56, 512, 26, 1024, 31, 40, 192, 18, 29, 2048, 384, 80, 60, 4096, 52, 8192, 112, 22, 768, 16384, 62, 17, 25, 160, 224, 32768, 27, 36, 120, 320, 1536, 65536, 58, 131072, 3072, 44, 63, 72, 104, 262144, 448, 640, 50, 524288, 61, 1048576, 6144, 21
Offset: 1
Keywords
Examples
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)
Links
Programs
-
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 *)
-
Scheme
(define (A253566 n) (A243071 (A122111 n)))
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
Comments