login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A275784 Number A(n,k) of up-down sequences with k copies each of 1,2,...,n; square array A(n,k), n>=0, k>=0, read by antidiagonals. 7

%I

%S 1,1,1,1,1,1,1,0,1,1,1,0,1,2,1,1,0,1,4,5,1,1,0,1,12,53,16,1,1,0,1,36,

%T 761,936,61,1,1,0,1,120,12661,87336,25325,272,1,1,0,1,400,229705,

%U 9929000,18528505,933980,1385,1,1,0,1,1400,4410665,1267945800,17504311533,6376563600,45504649,7936,1

%N Number A(n,k) of up-down sequences with k copies each of 1,2,...,n; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A275784/b275784.txt">Antidiagonals n = 0..15, flattened</a>

%e A(4,1) = 5: 1324, 1423, 2314, 2413, 3412.

%e A(3,2) = 4: 121323, 132312, 231213, 231312.

%e A(3,3) = 12: 121313232, 121323132, 121323231, 131213232, 132312132, 132323121, 231213132, 231213231, 231312132, 231323121, 232312131, 232313121.

%e A(2,4) = 1: 12121212.

%e Square array A(n,k) begins:

%e 1, 1, 1, 1, 1, 1, ...

%e 1, 1, 0, 0, 0, 0, ...

%e 1, 1, 1, 1, 1, 1, ...

%e 1, 2, 4, 12, 36, 120, ...

%e 1, 5, 53, 761, 12661, 229705, ...

%e 1, 16, 936, 87336, 9929000, 1267945800, ...

%e 1, 61, 25325, 18528505, 17504311533, 19126165462061, ...

%e 1, 272, 933980, 6376563600, 59163289699260, ...

%p b:= proc(n, l) option remember; `if`(l=[], 1, `if`(irem(add(i,

%p i=l), 2)=0, add(b(i, subsop(i=`if`(l[i]=1, [][], l[i]-1),

%p l)), i=n+1..nops(l)), add(b(i-`if`(l[i]=1, 1, 0), subsop(

%p i=`if`(l[i]=1, [][], l[i]-1), l)), i=1..n-1)))

%p end:

%p A:= (n, k)->`if`(k=0, 1, b(`if`(irem(k*n, 2)=0, 0, n+1), [k$n])):

%p seq(seq(A(n, d-n), n=0..d), d=0..10);

%t b[n_, l_List] := b[n, l] = If[l == {}, 1, If[EvenQ[Total[l]], Sum[b[i, ReplacePart[l, i -> If[l[[i]] == 1, Nothing, l[[i]]-1]]], {i, n+1, Length[l]}], Sum[b[i - If[l[[i]] == 1, 1, 0], ReplacePart[l, i -> If[l[[i]] == 1, Nothing, l[[i]]-1]]], {i, 1, n-1}]]]; A[n_, k_] := If[k == 0, 1, b[If[EvenQ[k*n], 0, n+1], Array[k&, n]]]; Table[A[n, d-n], {d, 0, 10}, {n, 0, d}] // Flatten (* _Jean-Fran├žois Alcover_, Jan 23 2017, adapted from Maple *)

%Y Columns k=0-3 give: A000012, A000111, A275801, A276636.

%Y Rows n=2-5 give: A000012, A241530, A036916, A276637.

%Y Cf. A269129.

%K nonn,tabl

%O 0,14

%A _Alois P. Heinz_, Aug 12 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 26 04:32 EDT 2019. Contains 321481 sequences. (Running on oeis4.)