cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

A054055 Largest digit of n.

Original entry on oeis.org

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
Offset: 0

Views

Author

Henry Bottomley, Apr 29 2000

Keywords

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

Examples

			a(12)=2 because 1 < 2.
		

Crossrefs

Cf. A054054.

Programs

  • 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
    
  • Magma
    [n eq 0 select 0 else Maximum(Intseq(n)): n in [0..104]]; // Bruno Berselli, Aug 24 2011
    
  • 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 *)
  • 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
    
  • Python
    def A054055(n): return max(int(d) for d in str(n)) # Chai Wah Wu, Jun 06 2022

A045844 a(n+1) = a(n) + largest digit of a(n); a(0) = 1.

Original entry on oeis.org

1, 2, 4, 8, 16, 22, 24, 28, 36, 42, 46, 52, 57, 64, 70, 77, 84, 92, 101, 102, 104, 108, 116, 122, 124, 128, 136, 142, 146, 152, 157, 164, 170, 177, 184, 192, 201, 203, 206, 212, 214, 218, 226, 232, 235, 240, 244, 248, 256, 262, 268, 276, 283, 291, 300, 303, 306
Offset: 0

Views

Author

Keywords

Examples

			a(17) = 92; a(18) = 92 + 9 = 101; a(19) = 101 + 1 = 102; a(20) = 102 + 2 = 104
		

Crossrefs

Partial sums of A132137.

Programs

  • Haskell
    a045844 n = a045844_list !! n
    a045844_list = iterate a095815 1
    -- Reinhard Zumkeller, Aug 23 2011
    
  • Mathematica
    NestList[#+Max[IntegerDigits[#]]&,1,60] (* Harvey P. Dale, Oct 25 2011 *)
  • PARI
    print1(a=1);for(i=1,99,print1(","a+=vecmax(digits(a)))) \\ M. F. Hasler, Jan 14 2014

Formula

a(0) = 1; a(n) = a(n-1) + MaxDigit(a(n-1)) for n > 0 where MaxDigit(x) is the largest digit in decimal notation for an integer x.
a(n+1) = A095815(a(n)). [Reinhard Zumkeller, Aug 23 2011]

A182324 n + (initial digit of n) in decimal representation.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 24 2012

Keywords

Comments

A061681 gives iteration when starting with 1.

Crossrefs

Programs

  • Haskell
    a182324 n = n + a000030 n
    
  • Magma
    [0] cat [n+d[#d] where d is Intseq(n): n in [1..65]]; // Bruno Berselli, Apr 25 2012

Formula

a(n) = n + A000030(n).
Showing 1-3 of 3 results.