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.

A177265 Number of permutations of {1,2,...,n} having exactly one string of consecutive fixed points (including singletons).

This page as a plain text file.
%I A177265 #33 May 27 2024 16:19:52
%S A177265 1,1,4,12,57,321,2176,17008,150505,1485465,16170036,192384876,
%T A177265 2483177809,34554278857,515620794592,8212685046336,139062777326001,
%U A177265 2494364438359953,47245095998005060,942259727190907180,19737566982241851721,433234326593362631601
%N A177265 Number of permutations of {1,2,...,n} having exactly one string of consecutive fixed points (including singletons).
%C A177265 Empirically the partial sums of A000240. - _Sean A. Irvine_, Jul 12 2022
%H A177265 Alois P. Heinz, <a href="/A177265/b177265.txt">Table of n, a(n) for n = 1..450</a>
%F A177265 a(n) = (1/2)*(1 - (-1)^n) + Sum_{j=1..n} d(j), where d(j) = A000166(j) are the derangement numbers.
%F A177265 a(1) = 1, a(2) = 1, a(n) = a(n-1) + n*A000166(n-1). - _Daniel Suteu_, Jan 25 2018
%F A177265 Conjecture: D-finite with recurrence a(n) - (n-1)*a(n-1) - (n-1)*a(n-2) +(n-1)*a(n-3) + (n-2)*a(n-4) = 0. - _R. J. Mathar_, Jul 01 2022
%e A177265 a(4,1) = 12 because we have (the string of consecutive fixed points is between square brackets): [1]342, [1]423, [12]43, [1234], 3[2]41, 4[2]13, 4[23]1, 24[3]1, 41[3]2, 21[34], 231[4], and 312[4].
%p A177265 d := proc (n) options operator, arrow: factorial(n)*(sum((-1)^i/factorial(i), i = 0 .. n)) end proc: a := proc (n) options operator, arrow: 1/2-(1/2)*(-1)^n+add(d(j), j = 1 .. n) end proc; seq(a(n), n = 1 .. 22);
%t A177265 a[0] = 1; a[n_] := a[n] = n*a[n - 1] + (-1)^n; f[n_] := Sum[(n - k) a[n - k - 1], {k, 0, n-1}]; Array[f, 20] (* _Robert G. Wilson v_, Apr 01 2011 *)
%o A177265 (Magma)
%o A177265 A000166:= func< n | Factorial(n)*(&+[(-1)^j/Factorial(j): j in [0..n]]) >;
%o A177265 A177265:= func< n | n le 2 select 1 else Self(n-1) + n*A000166(n-1) >;
%o A177265 [A177265(n): n in [1..30]]; // _G. C. Greubel_, May 19 2024
%o A177265 (SageMath)
%o A177265 def A000166(n): return factorial(n)*sum((-1)^j/factorial(j) for j in range(n+1))
%o A177265 def a(n): return 1 if n<3 else a(n-1) + n*A000166(n-1) # a = A177265
%o A177265 [a(n) for n in range(1,31)] # _G. C. Greubel_, May 19 2024
%Y A177265 Cf. A000166, A000240.
%Y A177265 Column A180192(n,1).
%K A177265 nonn
%O A177265 1,3
%A A177265 _Emeric Deutsch_, May 25 2010