cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Neven Juric (neven.juric(AT)apis-it.hr) and N. J. A. Sloane, Feb 23 2010

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Haskell
    import Data.List (permutations, sort)
    a170942 n k = a170942_tabf !! (n-1) (k-1)
    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..]
    -- Reinhard Zumkeller, Mar 29 2012

Extensions

a(36)-a(105) from John W. Layman, Feb 23 2010
Keyword tabf added by Reinhard Zumkeller, Mar 29 2012