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 A109002 #31 Jun 13 2025 08:21:46 %S A109002 9,89,899,8999,89999,899999,8999999,89999999,899999999,8999999999, %T A109002 89999999999,899999999999,8999999999999,89999999999999, %U A109002 899999999999999,8999999999999999,89999999999999999,899999999999999999,8999999999999999999,89999999999999999999,899999999999999999999 %N A109002 Maximal difference between two n-digit numbers. %H A109002 Vincenzo Librandi, <a href="/A109002/b109002.txt">Table of n, a(n) for n = 1..200</a> %H A109002 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (11,-10). %F A109002 a(n) = (10^n - 1) - 10^(n-1), n > 1. %F A109002 From _Reinhard Zumkeller_, May 28 2010: (Start) %F A109002 a(n) = A061601(A178500(n-1)). %F A109002 a(n+1) = 10*a(n) + 9. (End) %F A109002 G.f.: 9*x - x^2*(-89+80*x)/((10*x-1)*(x-1)). - _R. J. Mathar_, Oct 29 2011 %F A109002 From _Elmo R. Oliveira_, Jun 12 2025: (Start) %F A109002 E.g.f.: (1 + 10*x - 10*exp(x) - exp(10*x) + 10*exp(10*x))/10. %F A109002 a(n) = 11*a(n-1) - 10*a(n-2) for n >= 4. (End) %e A109002 a(1) = 9 - 0 = 9, a(4) = 9999 - 1000 = 8999. %t A109002 Join[{9},Table[FromDigits[PadRight[{8},n,9]],{n,2,20}]] (* or *) LinearRecurrence[{11,-10},{9,89,899},20] (* _Harvey P. Dale_, May 09 2021 *) %o A109002 (Magma) [9] cat [9*10^n-1: n in [1..30]]; // _Vincenzo Librandi_, Oct 29 2011 %o A109002 (PARI) a(n)=if(n>1,(10^n-1)-10^(n-1),9) \\ _Charles R Greathouse IV_, Oct 29 2011 %Y A109002 Cf. A061601, A178500. %K A109002 base,easy,nonn %O A109002 1,1 %A A109002 _Amarnath Murthy_, Aug 14 2005