login
Run Length Transform of swinging factorials (A056040).
9

%I #21 Feb 04 2022 14:36:37

%S 1,1,1,2,1,1,2,6,1,1,1,2,2,2,6,6,1,1,1,2,1,1,2,6,2,2,2,4,6,6,6,30,1,1,

%T 1,2,1,1,2,6,1,1,1,2,2,2,6,6,2,2,2,4,2,2,4,12,6,6,6,12,6,6,30,20,1,1,

%U 1,2,1,1,2,6,1,1,1,2,2,2,6,6,1,1,1,2,1,1

%N Run Length Transform of swinging factorials (A056040).

%C For the definition of the Run Length Transform see A246595.

%H Alois P. Heinz, <a href="/A246661/b246661.txt">Table of n, a(n) for n = 0..8191</a>

%F a(2^n-1) = n$ where n$ is the swinging factorial of n, A056040(n).

%t f[n_] := n!/Quotient[n, 2]!^2; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 85}] (* _Jean-François Alcover_, Jul 11 2017 *)

%o (Sage) # uses[RLT from A246660]

%o A246661_list = lambda len: RLT(lambda n: factorial(n)/factorial(n//2)^2, len)

%o A246661_list(88)

%o (Python)

%o # use RLT function from A278159

%o from math import factorial

%o def A246661(n): return RLT(n,lambda m: factorial(m)//factorial(m//2)**2) # _Chai Wah Wu_, Feb 04 2022

%Y Cf. A227349, A246588, A246595, A246596, A246660.

%K nonn,base

%O 0,4

%A _Peter Luschny_, Sep 07 2014