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!)
A357329 Triangular array read by rows: T(n, k) = number of occurrences of 2k as a sum |1 - p(1)| + |2 - p(2)| + ... + |n - p(n)|, where (p(1), p(2), ..., p(n)) ranges through the permutations of (1,2,...,n), for n >= 1, 0 <= k <= n-1. 3

%I #36 Oct 03 2022 12:31:15

%S 1,1,1,1,2,3,1,3,7,9,1,4,12,24,35,1,5,18,46,93,137,1,6,25,76,187,366,

%T 591,1,7,33,115,327,765,1523,2553,1,8,42,164,524,1400,3226,6436,11323,

%U 1,9,52,224,790,2350,6072,13768,27821,50461,1,10,63,296,1138,3708,10538,26480,59673,121626,226787

%N Triangular array read by rows: T(n, k) = number of occurrences of 2k as a sum |1 - p(1)| + |2 - p(2)| + ... + |n - p(n)|, where (p(1), p(2), ..., p(n)) ranges through the permutations of (1,2,...,n), for n >= 1, 0 <= k <= n-1.

%C In the Name, (1,2,...,n) can be replaced by any of its permutations. The first 10 row sums are the first 10 terms of A263898.

%H Alois P. Heinz, <a href="/A357329/b357329.txt">Rows n = 1..141, flattened</a>

%e First 8 rows:

%e 1

%e 1 1

%e 1 2 3

%e 1 3 7 9

%e 1 4 12 24 35

%e 1 5 18 46 93 137

%e 1 6 25 76 187 366 591

%e 1 7 33 115 327 765 1523 2553

%e For n=3, write

%e 123 123 123 123 123 123

%e 123 132 213 231 312 312

%e 000 011 110 112 211 211,

%e where row 3 represents |1 - p(1)| + |2 - p(2)| + |3 - p(n)| for the 6 permutations (p(1), p(2), p(2)) in row 3. The sums in row 3 are 0,2,2,4,4,4, so that the numbers 0, 2, 4 occur with multiplicities 1, 2, 3, as in row 3 of the array.

%p g:= proc(h, n) local i, j; j:= irem(h, 2, 'i');

%p 1-`if`(h=n, 0, (i+1)*z*t^(i+j)/g(h+1, n))

%p end:

%p T:= n-> (p-> seq(coeff(p, t, k), k=0..n-1))

%p (coeff(series(1/g(0, n), z, n+1), z, n)):

%p seq(T(n), n=1..12); # _Alois P. Heinz_, Oct 02 2022

%t p[n_] := p[n] = Permutations[Range[n]];

%t f[n_, k_] := f[n, k] = Abs[p[n][[k]] - Range[n]]

%t c[n_, k_] := c[n, k] = Total[f[n, k]]

%t t[n_] := Table[c[n, k], {k, 1, n!}]

%t u = Table[Count[t[n], 2 m], {n, 1, 10}, {m, 0, n - 1}] (* A357329, array *)

%t Flatten[u] (* A357329, sequence *)

%Y Cf. A000142, A263898.

%Y Subtriangle of A062869.

%K nonn,tabl

%O 1,5

%A _Clark Kimberling_, Sep 24 2022

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 May 10 01:53 EDT 2024. Contains 372354 sequences. (Running on oeis4.)