login
Number of length n mixed-radix numbers with base [2, 3, 4, ...] (factorial base) such that the parities of adjacent digits differ.
1

%I #48 Jul 01 2024 19:18:18

%S 1,2,3,6,16,48,180,720,3456,17280,100800,604800,4147200,29030400,

%T 228614400,1828915200,16257024000,146313216000,1448500838400,

%U 14485008384000,158018273280000,1738201006080000,20713561989120000,248562743869440000,3212195459235840000

%N Number of length n mixed-radix numbers with base [2, 3, 4, ...] (factorial base) such that the parities of adjacent digits differ.

%C Leading zeros are permitted.

%C The base [2, 3, 4, ...] in the definition is sometimes called "rising factorial base". Using the "falling factorial base" [..., 4, 3, 2] gives the same sequence.

%C The number of such factorial numbers without any condition for the digit is (n+1)!.

%H Alois P. Heinz, <a href="/A219024/b219024.txt">Table of n, a(n) for n = 0..200</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Factorial_number_system">Factorial number system</a>.

%F For n > 1, a(2n-1) = n * a(2n-2) = (n^2-1) * a(2n-3). - _Jon Perry_, Nov 15 2012

%F a(n) = (n - N)! * N! * (N + 2), where N = floor(n/2), for n > 0. - _Peter Luschny_, Jul 01 2024

%e The a(4) = 16 such numbers are (dots for zeros):

%e [ 1] [ . 1 . 1 ]

%e [ 2] [ . 1 . 3 ]

%e [ 3] [ . 1 2 1 ]

%e [ 4] [ . 1 2 3 ]

%e [ 5] [ 1 . 1 . ]

%e [ 6] [ 1 . 1 2 ]

%e [ 7] [ 1 . 1 4 ]

%e [ 8] [ 1 . 3 . ]

%e [ 9] [ 1 . 3 2 ]

%e [10] [ 1 . 3 4 ]

%e [11] [ 1 2 1 . ]

%e [12] [ 1 2 1 2 ]

%e [13] [ 1 2 1 4 ]

%e [14] [ 1 2 3 . ]

%e [15] [ 1 2 3 2 ]

%e [16] [ 1 2 3 4 ]

%p a:= proc(n) option remember; `if`(n<4, 1+(5+(n-3)*n)*n/3,

%p (2*(n-6)*(n+1) *a(n-1)+ n*(n-1)*(n-2)*(n+3) *a(n-2))/

%p (4*(n-3)*(n+2)))

%p end:

%p seq(a(n), n=0..30); # _Alois P. Heinz_, Nov 15 2012

%p A219024 := proc(n) iquo(n, 2); ifelse(n = 0, 1, (n - %)! * %! *(% + 2)) end:

%p seq(A219024(n), n = 0..24); # _Peter Luschny_, Jul 01 2024

%t a[0] = 1; a[1] = 2; a[n_?EvenQ] = a[n] = n*(n+4)/(2*(n+2))*a[n-1]; a[n_?OddQ] := a[n] = (n+1)/2*a[n-1]; Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Apr 08 2015 *)

%K nonn,base

%O 0,2

%A _Joerg Arndt_, Nov 10 2012