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 A284816 #62 Feb 27 2024 19:09:39 %S A284816 1,4,21,132,960,7920,73080,745920,8346240,101606400,1337212800, %T A284816 18920563200,286442956800,4620449433600,79114299264000, %U A284816 1433211107328000,27387931963392000,550604138692608000,11617107089043456000,256671161862635520000,5926549291918295040000 %N A284816 Sum of entries in the first cycles of all permutations of [n]. %C A284816 Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements. %C A284816 Also, the number of colorings of n+1 given balls, two thereof identical, using n given colors (each color is used). - _Ivaylo Kortezov_, Jan 27 2024 %H A284816 Alois P. Heinz, <a href="/A284816/b284816.txt">Table of n, a(n) for n = 1..448</a> %H A284816 Ivaylo Kortezov, <a href="/A284816/a284816.pdf">Winter Math Contest Yambol 2024, Bulgaria</a> (in Bulgarian), Problem 8.3. %H A284816 Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a>. %F A284816 a(n) = n!*(n*(n+1) - (n-1)*(n+2)/2)/2. %F A284816 E.g.f.: -x*(x^2-2*x+2)/(2*(x-1)^3). %F A284816 a(n) = (n^2+n+2)*n*a(n-1)/(n^2-n+2) for n > 1, a(n) = n for n < 2. %F A284816 a(n) = n*A006595(n-1). - _Ivaylo Kortezov_, Feb 02 2024 %e A284816 a(3) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21. %p A284816 a:= n-> n!*(n*(n+1)-(n-1)*(n+2)/2)/2: %p A284816 seq(a(n), n=1..25); %p A284816 # second Maple program: %p A284816 a:= proc(n) option remember; `if`(n<2, n, %p A284816 (n^2+n+2)*n*a(n-1)/(n^2-n+2)) %p A284816 end: %p A284816 seq(a(n), n=1..25); %Y A284816 Cf. A006595, A180119, A185105, A285363, A285382. %Y A284816 Column k=1 of A285439. %K A284816 nonn %O A284816 1,2 %A A284816 _Alois P. Heinz_, Apr 15 2017