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.

A246757 Largest n-digit number divisible by the product of its decimal digits.

Original entry on oeis.org

9, 36, 816, 9612, 93744, 973728, 9939915, 99221112, 997711344, 9993393711, 99934212672, 999641938176, 9999121936392, 99996414731136, 999994123418112, 9999982411646976, 99999318116613312, 999991631331122112, 9999944111773994112, 99999911232931433472, 999999832211912282112
Offset: 1

Views

Author

Max Alekseyev, Sep 02 2014

Keywords

Comments

The smallest such numbers are given by repunits A000042 or A002275.

Crossrefs

Subsequence of A007602.

Programs

  • PARI
    { A246757(n) = my(m,d,p,q); m=n\2; forstep(k=10^m-1,(10^m-1)/9,-1, d=digits(k); q=prod(i=1,#d,d[i]); if(q==0,next); forstep(s=(((k+1)*10^(n-m))\q)*q,k*10^(n-m),-q,  d=digits(s); p=prod(i=1,#d,d[i]); if(p==0 || s%p,next); return(s) )) }
    
  • Python
    from operator import mul
    from functools import reduce
    def A246757(n):
        for i in range(10**n-1,int('1'*n)-1,-1):
            pd = reduce(mul,(int(d) for d in str(i)))
            if pd and not i % pd:
                return i # Chai Wah Wu, Sep 08 2014