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.

A063543 a(n) = n - product of the nonzero digits of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 18, 19, 18, 17, 16, 15, 14, 13, 12, 11, 27, 28, 26, 24, 22, 20, 18, 16, 14, 12, 36, 37, 34, 31, 28, 25, 22, 19, 16, 13, 45, 46, 42, 38, 34, 30, 26, 22, 18, 14, 54, 55, 50, 45, 40, 35, 30, 25, 20, 15, 63, 64, 58
Offset: 1

Views

Author

N. J. A. Sloane, Aug 14 2001

Keywords

Comments

The graph somewhat resembles wisteria flowers.

Examples

			a(20) = 20 - 2 = 18.
		

Crossrefs

Programs

  • Magma
    [n - &*[a: k in [1..#Intseq(n)] | a ne 0 where a is Intseq(n)[k]]: n in [1..100]]; // Marius A. Burtea, Sep 16 2019
  • Maple
    a:= n-> n-mul(i, i=subs(0=1, convert(n, base, 10))):
    seq(a(n), n=1..80);  # Alois P. Heinz, Aug 18 2019
  • Mathematica
    Table[n - Times@@DeleteCases[IntegerDigits[n], 0], {n, 70}] (* Alonso del Arte, Dec 15 2013 *)
  • PARI
    a(n) = my(d=select(x->(x!=0), digits(n))); n - vecprod(d); \\ Michel Marcus, Jan 13 2020
    
  • Python
    def a(n):
        digits = map(int, str(n))
        product = 1
        for d in digits:
            if d != 0:
                product *= d
        return n - product
    [a(n) for n in range(20)]
    # Elisabeth Zemack, Sep 16 2019; corrected by Fabio Somenzi, Jan 13 2020
    

Formula

a(n) = n - A051801(n).

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Aug 14 2001