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 A333631 #13 Jan 27 2024 14:24:51 %S A333631 0,0,0,2,6,40,238,1760,14076,131732,1308670,14678452,176166906, %T A333631 2317481348,32416648496,490915956484,7846449011500,134291298372632, %U A333631 2416652824505150,46141903780094080,922528719841017424,19456439433050482412,427837767407051523776,9873256397944571377332 %N A333631 Number of permutations of {1..n} with three consecutive terms in arithmetic progression. %C A333631 Also permutations whose second differences have at least one zero. %H A333631 Wikipedia, <a href="https://en.wikipedia.org/wiki/Arithmetic_progression">Arithmetic progression</a> %F A333631 a(n) = n! - A295370(n). %e A333631 The a(3) = 2 and a(4) = 6 permutations: %e A333631 (1,2,3) (1,2,3,4) %e A333631 (3,2,1) (1,4,3,2) %e A333631 (2,3,4,1) %e A333631 (3,2,1,4) %e A333631 (4,1,2,3) %e A333631 (4,3,2,1) %t A333631 Table[Select[Permutations[Range[n]],MatchQ[Differences[#],{___,x_,x_,___}]&]//Length,{n,0,8}] %Y A333631 The complement is counted by A295370. %Y A333631 The version for prime indices is A333195. %Y A333631 Strict partitions with equal differences are A049980. %Y A333631 Partitions with equal differences are A049988. %Y A333631 Compositions without triples in arithmetic progression are A238423. %Y A333631 Partitions without triples in arithmetic progression are A238424. %Y A333631 Strict partitions without triples in arithmetic progression are A332668. %Y A333631 Cf. A000142, A007862, A175342, A325849, A325850. %K A333631 nonn %O A333631 0,4 %A A333631 _Gus Wiseman_, Mar 31 2020 %E A333631 a(11)-a(21) (using A295370) from _Giovanni Resta_, Apr 07 2020 %E A333631 a(22)-a(23) (using A295370) from _Alois P. Heinz_, Jan 27 2024