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 A104854 #33 Jun 15 2022 01:50:11 %S A104854 1,1,3,8,27,106,483,2498,14487,93106,657063,5051738,42033747, %T A104854 376353706,3608153643,36879266978,400339173807,4599894007906, %U A104854 55772890550223,711653491362218,9532624918010667,133746250733151706,1961498898620566803 %N A104854 Number of n-digit numbers using digits 0 to n-1 each exactly once and containing no 3-digit sequence in increasing or decreasing order. %C A104854 Leading zeros are not allowed, but digits > 9 are permitted. %C A104854 Derived from A001250: 1, 2, 4, 10, 32, 122, 544, 2770, 15872, 101042, 707584, 5405530, ... giving 1, 1 and 4-2/2, 10-4/2, 32-10/2, 122-32/2=106, 544-122/2=483, ... %H A104854 D. Berry, J. Broom, D. Dixon, and A. Flaherty, <a href="https://www.math.lsu.edu/system/files/DeAngelisProject2.pdf">Umbral Calculus and the Boustrophedon Transform</a>, 2013. %F A104854 For n>2, a(n) = A001250(n) - A001250(n-1)/2 = A001250(n) - A000111(n). %F A104854 a(n) = 2*A000111(n+1)-A000111(n) [Berry et al., 2013] (but compare A231895). - _N. J. A. Sloane_, Nov 18 2013 %F A104854 E.g.f: 1+(sec(x)+tan(x)-1)*(sec(x)+tan(x)). - _Sergei N. Gladkovskii_, Nov 07 2014 %e A104854 The n-digit numbers contributing to the counts are: %e A104854 n=1: 0; %e A104854 n=2: 10; %e A104854 n=3: 102, 120, 201; %e A104854 n=4: 1032, 1203, 1302, 2031, 2130, 2301, 3021, 3120; %e A104854 n=5: 10324, 10423, 12043,...,41302, 42301; %e A104854 G.f.: 1 + x + 3*x^2 + 8*x^3 + 27*x^4 + 106*x^5 + 483*x^6 + 2498*x^7 + ... %p A104854 A001250 := proc(n) local x; if n = 1 then 1; else n!*coeftayl( 2*(tan(x)+sec(x)),x=0,n) ; fi ; end: A104854 := proc(n) if n <= 2 then 1; else A001250(n)-A001250(n-1)/2 ; fi ; end: seq(A104854(n),n=1..30) ; # _R. J. Mathar_, Feb 14 2008 %t A104854 m = 23; %t A104854 CoefficientList[1 + (Sec[x] + Tan[x] - 1)(Sec[x] + Tan[x]) + O[x]^m, x]* Range[0, m - 1]! (* _Jean-François Alcover_, Mar 31 2020 *) %o A104854 (Python) %o A104854 from itertools import accumulate, islice %o A104854 def A104854_gen(): # generator of terms %o A104854 yield 1 %o A104854 blist = (0,1) %o A104854 while True: %o A104854 yield -blist[-1]+2*(blist := tuple(accumulate(reversed(blist),initial=0)))[-1] %o A104854 A104854_list = list(islice(A104854_gen(),40)) # _Chai Wah Wu_, Jun 14 2022 %Y A104854 Cf. A000111, A104854, A001250. %K A104854 nonn %O A104854 1,3 %A A104854 Michel Criton (mcriton(AT)wanadoo.fr), Apr 23 2005 and May 29 2005 %E A104854 More terms from _R. J. Mathar_, Feb 14 2008