login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332783 The number of permutations of {(n+1) 1's, (n+1) 2's, ..., (n+1) n's} with the property that k's are equally spaced for k=1..n and the interval of k+1 is less than or equal to the interval of k for k=1..n-1. 5

%I #41 Sep 26 2023 14:01:43

%S 1,4,16,104,484,4848,25104,300336,2335296,27953952,198725952,

%T 4731323904,33020828928,606237831936,8936541384192,174694058933760,

%U 1628654065588224,56338295740213248,545177455792662528,20766878061520306176,340162958990367645696

%N The number of permutations of {(n+1) 1's, (n+1) 2's, ..., (n+1) n's} with the property that k's are equally spaced for k=1..n and the interval of k+1 is less than or equal to the interval of k for k=1..n-1.

%e Define the interval of k as b(k).

%e In case of n = 1.

%e | | b(1)

%e -----+--------+-----

%e 1 | [1, 1] | [0]

%e In case of n = 2.

%e | | b(1),b(2)

%e -----+--------------------+----------

%e 1 | [2, 2, 2, 1, 1, 1] | [0, 0]

%e 2 | [2, 1, 2, 1, 2, 1] | [1, 1]

%e 3 | [1, 2, 1, 2, 1, 2] | [1, 1]

%e 4 | [1, 1, 1, 2, 2, 2] | [0, 0]

%e In case of n = 3.

%e | | b(1),b(2),b(3)

%e -----+--------------------------------------+---------------

%e 1 | [3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1] | [0, 0, 0]

%e 2 | [3, 3, 3, 3, 2, 1, 2, 1, 2, 1, 2, 1] | [1, 1, 0]

%e 3 | [3, 3, 3, 3, 1, 2, 1, 2, 1, 2, 1, 2] | [1, 1, 0]

%e 4 | [3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2] | [0, 0, 0]

%e 5 | [3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1] | [2, 2, 2]

%e 6 | [3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2] | [2, 2, 2]

%e 7 | [2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1] | [2, 2, 2]

%e 8 | [1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2] | [2, 2, 2]

%e 9 | [2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3] | [2, 2, 2]

%e 10 | [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3] | [2, 2, 2]

%e 11 | [2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1] | [0, 0, 0]

%e 12 | [1, 1, 1, 1, 3, 3, 3, 3, 2, 2, 2, 2] | [0, 0, 0]

%e 13 | [2, 2, 2, 2, 1, 1, 1, 1, 3, 3, 3, 3] | [0, 0, 0]

%e 14 | [2, 1, 2, 1, 2, 1, 2, 1, 3, 3, 3, 3] | [1, 1, 0]

%e 15 | [1, 2, 1, 2, 1, 2, 1, 2, 3, 3, 3, 3] | [1, 1, 0]

%e 16 | [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3] | [0, 0, 0]

%o (Ruby)

%o def search(a, num, d, k, n)

%o if num == 0

%o @cnt += 1

%o else

%o (k * n - k + 1).times{|i|

%o if a[i] == 0

%o (i + d + 1..k * n - k + 1).each{|j|

%o if (k - 1) * j - (k - 2) * i < k * n

%o if (1..k - 1).all?{|m| a[m * j - (m - 1) * i] == 0}

%o (0..k - 1).each{|m| a[m * j - (m - 1) * i] = num}

%o search(a, num - 1, j - i - 1, k, n)

%o (0..k - 1).each{|m| a[m * j - (m - 1) * i] = 0}

%o end

%o end

%o }

%o end

%o }

%o end

%o end

%o def A(k, n)

%o a = [0] * k * n

%o @cnt = 0

%o search(a, n, 0, k, n)

%o @cnt

%o end

%o def A332783(n)

%o (1..n).map{|i| A(i + 1, i)}

%o end

%o p A332783(5)

%Y Cf. A104442, A332762, A332784, A322178, A332748, A332752, A332773.

%K nonn

%O 1,2

%A _Seiichi Manyama_, Feb 23 2020

%E a(9)-a(17) from _Bert Dobbelaere_, Mar 08 2020

%E a(18)-a(21) from _Max Alekseyev_, Sep 26 2023

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 20 11:19 EDT 2024. Contains 374445 sequences. (Running on oeis4.)