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 A371998 #6 Apr 25 2024 13:23:21 %S A371998 1,1,0,0,1,3,2,8,9,45,44,264,265,1855,1854,14832,14833,133497,133496, %T A371998 1334960,1334961,14684571,14684570,176214840,176214841,2290792933, %U A371998 2290792932,32071101048,32071101049,481066515735,481066515734,7697064251744,7697064251745 %N A371998 a(n) = A000166(floor(n/2)) if n is even otherwise A000240(floor((n + 1)/2)). %p A371998 a := n -> if irem(n,2) = 0 then A000166(iquo(n,2)) else A000240(iquo(n+1,2)) fi: %p A371998 seq(a(n), n = 0..32); %o A371998 (Python) %o A371998 from functools import cache %o A371998 @cache %o A371998 def sf(n): %o A371998 if n == 0: return 1 %o A371998 return n * sf(n - 1) + (-1 if n % 2 else 1) %o A371998 def a(n): %o A371998 h, r = divmod(n, 2) %o A371998 return sf(h) * (h + 1) if r else sf(h) %o A371998 print([a(n) for n in range(33)]) %Y A371998 Cf. A000166, A000240. %K A371998 nonn %O A371998 0,6 %A A371998 _Peter Luschny_, Apr 25 2024