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 A204692 #62 Jul 28 2023 11:26:21 %S A204692 0,0,525,8325,95046,987048,9969183,99932013,999859093,9999722967, %T A204692 99999479435,999999059545,9999998358645,99999997221695, %U A204692 999999995423887,9999999992645451,99999999988439336,999999999982190246,9999999999973063281,99999999999959940181,999999999999941340896 %N A204692 a(n) is the number of base-10 bouncy numbers below 10^n. %C A204692 A bouncy number has digits that are neither monotonically increasing nor decreasing from left to right. %H A204692 Muniru A Asiru, <a href="/A204692/b204692.txt">Table of n, a(n) for n = 1..200</a> %H A204692 Project Euler, <a href="http://projecteuler.net/problem=113">Non-bouncy numbers Problem 113</a> %H A204692 <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (21,-165,715,-1980,3762,-5082,4950,-3465,1705,-561,111,-10). %F A204692 a(1) = a(2) = 0. For n > 2, a(n) = 10^n - binomial(n+9, n) + 10*n - Sum_{i=1..n} binomial(i+9, i) = 10^n - binomial(n+10, 10) - binomial(n+9, 9) + 10*n + 1. [Corrected by _Altug Alkan_, Sep 28 2018] %F A204692 From _Chai Wah Wu_, Jul 28 2023: (Start) %F A204692 a(n) = 21*a(n-1) - 165*a(n-2) + 715*a(n-3) - 1980*a(n-4) + 3762*a(n-5) - 5082*a(n-6) + 4950*a(n-7) - 3465*a(n-8) + 1705*a(n-9) - 561*a(n-10) + 111*a(n-11) - 10*a(n-12) for n > 12. %F A204692 G.f.: x^3*(89*x^8 - 798*x^7 + 3175*x^6 - 7350*x^5 + 10890*x^4 - 10668*x^3 + 6846*x^2 - 2700*x + 525)/((x - 1)^11*(10*x - 1)). (End) %e A204692 a(3) = 525 because there are 525 base-10 bouncy numbers < 10^3; the smallest is A152054(1) = 101 and the largest one is A152054(525) = 989. %e A204692 a(4) = 8325 because A152054(8325) = 9989 is the largest base-10 bouncy number < 10^4. %p A204692 a:=n->`if`(n<=2,0,10^n-(binomial(n+10,10)+binomial(n+9,9)-1-10*n)); seq(a(n),n=1..25); # _Muniru A Asiru_, Sep 28 2018 %t A204692 a[n_]:= 10^n - Binomial[n+10, 10] - Binomial[n+9, 9] + 10*n + 1; Array[a, 25] (* _Stefano Spezia_, Sep 29 2018 *) %o A204692 (PARI) a(n) = if(n<3, 0, 10^n-(binomial(n+10,10)+binomial(n+9, 9)-1-10*n)); \\ _Altug Alkan_, Sep 27 2018 %o A204692 (GAP) a:=[0,0];; for n in [3..25] do a[n]:=10^n-(Binomial(n+10,10)+Binomial(n+9,9)-1-10*n); od; a; # _Muniru A Asiru_, Sep 28 2018 %o A204692 (Magma) [n le 2 select 0 else (10^n - Binomial(n+10, 10) - Binomial(n+9, 9) + 10*n + 1): n in [1..25]]; // _G. C. Greubel_, Nov 24 2018 %o A204692 (Sage) %o A204692 def A204692(n): %o A204692 if n <= 2: %o A204692 return 0 %o A204692 else: %o A204692 return (10^n - binomial(n+10, 10) - binomial(n+9, 9) + 10*n + 1) %o A204692 [A204692(n) for n in (1..25)] # _G. C. Greubel_, Nov 24 2018 %Y A204692 Cf. A152054. %K A204692 nonn,base,easy %O A204692 1,3 %A A204692 _Thomas Quirk_, Jan 18 2012 %E A204692 Corrected and extended by _Altug Alkan_, Sep 27 2018