This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A037904 Greatest digit of n - least digit of n. 13
 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,13 COMMENTS a(n) = A054055(n)-A054054(n); a(A010785(n)) = 0; for k>0: a(n) = a(n*10^k + A000030(n)) = a(n*10^k + A010879(n)) = a(n*10^k + A054054(n)) = a(n*10^k + A054055(n)) . - Reinhard Zumkeller, Dec 14 2007; corrected by David Wasserman, May 21 2008 LINKS R. Zumkeller, Table of n, a(n) for n = 1..10000 MAPLE f:= n -> (max-min)(convert(n, base, 10)): map(f, [\$1..1000]); # Robert Israel, Jul 07 2016 MATHEMATICA f[n_] := Block[{d = IntegerDigits[n]}, Max[d] - Min[d]]; Table[ f[n], {n, 1, 15}] PROG (Haskell) a037904 = f 9 0 where    f u v 0 = v - u    f u v z = f (min u d) (max v d) z' where (z', d) = divMod z 10 -- Reinhard Zumkeller, Dec 16 2013 (PARI) a(n)=my(d=digits(n)); vecmax(d)-vecmin(d) \\ Charles R Greathouse IV, Feb 07 2017 CROSSREFS Cf. A040163, A064834. Sequence in context: A030108 A307651 A297330 * A070615 A040114 A064834 Adjacent sequences:  A037901 A037902 A037903 * A037905 A037906 A037907 KEYWORD nonn,base,nice AUTHOR EXTENSIONS Incorrect comments deleted by Robert Israel, Jul 07 2016 STATUS approved

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

Last modified October 21 06:24 EDT 2019. Contains 328292 sequences. (Running on oeis4.)