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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A054055 Largest digit of n. 102
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9, 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 6, 6, 6, 6, 6, 6, 6, 7, 8, 9, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 2, 3, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
A095815(n) = n + a(n). - Reinhard Zumkeller, Aug 23 2011
a(A007088(n)) = 1, n > 0; a(A136399(n)) > 1. - Reinhard Zumkeller, Apr 25 2012
a(n) = 9 for almost all n. Sum_{n < x} a(n) = 9x + O(.956^x). - Charles R Greathouse IV, Oct 02 2013
LINKS
EXAMPLE
a(12)=2 because 1 < 2.
MAPLE
[seq(max(convert(n, base, 10)), n=0..120)];
MATHEMATICA
f[n_] := Sort[IntegerDigits[n]][[-1]]; Array[f, 105, 0] (* Alonso del Arte, May 14 2011 *) (* and revised by Robert G. Wilson v, Aug 24 2011 *)
Max/@IntegerDigits[Range[0, 110]] (* Harvey P. Dale, Apr 17 2016 *)
PROG
(Haskell)
a054055 = f 0 where
f m x | x <= 9 = max m x
| otherwise = f (max m d) x' where (x', d) = divMod x 10
-- Reinhard Zumkeller, Jun 20 2012, May 14 2011
(PARI) a(n)=vecmax(eval(Vec(Str(n)))) \\ Charles R Greathouse IV, Jun 16 2011
(PARI) a(n)=vecmax(digits(n)) \\ Charles R Greathouse IV, Oct 02 2013
(Magma) [n eq 0 select 0 else Maximum(Intseq(n)): n in [0..104]]; // Bruno Berselli, Aug 24 2011
(Python)
def A054055(n): return max(int(d) for d in str(n)) # Chai Wah Wu, Jun 06 2022
CROSSREFS
Cf. A054054.
Sequence in context: A065881 A133048 A214950 * A067456 A052429 A051802
KEYWORD
base,easy,nonn,look
AUTHOR
Henry Bottomley, Apr 29 2000
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | 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 March 19 03:33 EDT 2024. Contains 370952 sequences. (Running on oeis4.)