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-2 of 2 results.

A217928 Sum of distinct decimal digits appearing in n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 2, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 3, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 4, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 5, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 6, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 7, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15, 8, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 1
Offset: 0

Views

Author

Max Alekseyev, Oct 15 2012

Keywords

Comments

a(n) <= 45 = 1+2+3+4+5+6+7+8+9; A227378(n) = smallest number m such that a(m) = n, 0 <= n <= 45. - Reinhard Zumkeller, Jul 09 2013

Crossrefs

Programs

  • Haskell
    import Data.List (nub)
    a217928 = sum . nub . map (read . return) . show :: Integer -> Integer
    -- Reinhard Zumkeller, Jul 09 2013
    
  • Maple
    a:= n-> add(i, i={convert(n, base, 10)[]}):
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 21 2022
  • PARI
    { a(n) = local( d = vecsort( eval(Vec(Str(n))),,8) ); sum(i=1,#d,d[i]) }
    
  • PARI
    a(n) = vecsum(Set(digits(n))); \\ Michel Marcus, Sep 13 2022
    
  • Python
    def a(n): return sum(map(int, set(str(n))))
    print([a(n) for n in range(101)]) # Michael S. Branicky, Sep 13 2022

Formula

a(n) = A007953(A180410(n)). - Michel Marcus, Sep 21 2022

A381645 a(n) is the largest integer with distinct digits whose digital sum is n.

Original entry on oeis.org

0, 10, 20, 210, 310, 410, 3210, 4210, 5210, 6210, 43210, 53210, 63210, 73210, 83210, 543210, 643210, 743210, 843210, 943210, 953210, 6543210, 7543210, 8543210, 9543210, 9643210, 9743210, 9843210, 76543210, 86543210, 96543210, 97543210, 98543210, 98643210, 98743210, 98753210, 876543210, 976543210, 986543210, 987543210, 987643210, 987653210, 987654210, 987654310, 987654320, 9876543210
Offset: 0

Views

Author

Gonzalo Martínez, Mar 03 2025

Keywords

Comments

Since all the terms in this list have distinct digits, the highest possible digit sum is that of the number 987654321, which is 45. Therefore, this list is finite and has 46 terms.
All terms == 0 (mod 10).
All terms are members of A009995.

Examples

			For n = 5, the integers with distinct digits whose digital sum is 5 are: 5, 14, 23, 32, 41, 50, 104, 140, 203, 230, 302, 320, 401 and 410, where the largest of them is 410. So, a(5) = 410.
		

Crossrefs

Showing 1-2 of 2 results.