

A170942


Take the permutations of lengths 1, 2, 3, ... arranged lexicographically, and replace each permutation with the number of its fixed points.


19



1, 2, 0, 3, 1, 1, 0, 0, 1, 4, 2, 2, 1, 1, 2, 2, 0, 1, 0, 0, 1, 1, 0, 2, 1, 0, 0, 0, 1, 1, 2, 0, 0, 5, 3, 3, 2, 2, 3, 3, 1, 2, 1, 1, 2, 2, 1, 3, 2, 1, 1, 1, 2, 2, 3, 1, 1, 3, 1, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 1, 0, 2, 1, 0, 0, 0, 1, 1, 2, 0, 0, 2, 0, 1, 0, 0, 1, 3, 1, 2, 1, 1, 2, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Length of nth row = sum of nth row = n!; number of zeros in nth row = A000166(n); number of positive terms in nth row = A002467(n). [Reinhard Zumkeller, Mar 29 2012]


LINKS



EXAMPLE

123,132,213,231,312,321 (corresponding to 3rd row of triangle A030298) have respectively 3,1,1,0,0,1 fixed points.


PROG

(Haskell)
import Data.List (permutations, sort)
a170942 n k = a170942_tabf !! (n1) (k1)
a170942_row n = map fps $ sort $ permutations [1..n] where
fps perm = sum $ map fromEnum $ zipWith (==) perm [1..n]
a170942_tabf = map a170942_row [1..]


CROSSREFS

Cf. A008290, A000166, A000240, A000387, A000449, A000475, A129135, A129136, A129149, A129153, A129217, A129218, A129238, A129255.


KEYWORD

nonn,tabf


AUTHOR



EXTENSIONS



STATUS

approved



