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.
%I A170942 #30 Mar 31 2017 20:33:49 %S A170942 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, %T A170942 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, %U A170942 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 %N A170942 Take the permutations of lengths 1, 2, 3, ... arranged lexicographically, and replace each permutation with the number of its fixed points. %C A170942 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] %H A170942 Reinhard Zumkeller, <a href="/A170942/b170942.txt">Rows n=1..7 of triangle, flattened</a> %H A170942 FindStat - Combinatorial Statistic Finder, <a href="http://www.findstat.org/St000022">The number of fixed points of a permutation</a> %e A170942 123,132,213,231,312,321 (corresponding to 3rd row of triangle A030298) have respectively 3,1,1,0,0,1 fixed points. %o A170942 (Haskell) %o A170942 import Data.List (permutations, sort) %o A170942 a170942 n k = a170942_tabf !! (n-1) (k-1) %o A170942 a170942_row n = map fps $ sort $ permutations [1..n] where %o A170942 fps perm = sum $ map fromEnum $ zipWith (==) perm [1..n] %o A170942 a170942_tabf = map a170942_row [1..] %o A170942 -- _Reinhard Zumkeller_, Mar 29 2012 %Y A170942 Cf. A030298, A030299. %Y A170942 Cf. A008290, A000166, A000240, A000387, A000449, A000475, A129135, A129136, A129149, A129153, A129217, A129218, A129238, A129255. %Y A170942 Cf. A008291. %K A170942 nonn,tabf %O A170942 1,2 %A A170942 Neven Juric (neven.juric(AT)apis-it.hr) and _N. J. A. Sloane_, Feb 23 2010 %E A170942 a(36)-a(105) from _John W. Layman_, Feb 23 2010 %E A170942 Keyword tabf added by _Reinhard Zumkeller_, Mar 29 2012