login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Maximal difference between two n-digit numbers.
6

%I #22 Sep 08 2022 08:45:19

%S 9,89,899,8999,89999,899999,8999999,89999999,899999999,8999999999,

%T 89999999999,899999999999,8999999999999,89999999999999,899999999999999

%N Maximal difference between two n-digit numbers.

%C a(n) = A061601(A178500(n-1)). - _Reinhard Zumkeller_, May 28 2010

%H Vincenzo Librandi, <a href="/A109002/b109002.txt">Table of n, a(n) for n = 1..200</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (11,-10).

%F a(n) = (10^n -1) - 10^(n-1), n > 1.

%F a(n+1) = 10*a(n) + 9. - _Reinhard Zumkeller_, May 28 2010

%F G.f.: 9*x - x^2*(-89+80*x) / ( (10*x-1)*(x-1) ). - _R. J. Mathar_, Oct 29 2011

%e a(1) = 9 - 0 = 9, a(4) = 9999 - 1000 = 8999.

%t 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 (Magma) [9],[9*10^n-1: n in [1..30]]; // _Vincenzo Librandi_, Oct 29 2011

%o (PARI) a(n)=if(n>1,(10^n-1)-10^(n-1),9) \\ _Charles R Greathouse IV_, Oct 29 2011

%K base,easy,nonn

%O 1,1

%A _Amarnath Murthy_, Aug 14 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 24 07:26 EDT 2024. Contains 376187 sequences. (Running on oeis4.)