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.

This page as a plain text file.
%I A246757 #23 May 11 2020 02:27:19
%S A246757 9,36,816,9612,93744,973728,9939915,99221112,997711344,9993393711,
%T A246757 99934212672,999641938176,9999121936392,99996414731136,
%U A246757 999994123418112,9999982411646976,99999318116613312,999991631331122112,9999944111773994112,99999911232931433472,999999832211912282112
%N A246757 Largest n-digit number divisible by the product of its decimal digits.
%C A246757 The smallest such numbers are given by repunits A000042 or A002275.
%H A246757 Max Alekseyev, <a href="/A246757/b246757.txt">Table of n, a(n) for n = 1..30</a>
%o A246757 (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) )) }
%o A246757 (Python)
%o A246757 from operator import mul
%o A246757 from functools import reduce
%o A246757 def A246757(n):
%o A246757     for i in range(10**n-1,int('1'*n)-1,-1):
%o A246757         pd = reduce(mul,(int(d) for d in str(i)))
%o A246757         if pd and not i % pd:
%o A246757             return i # _Chai Wah Wu_, Sep 08 2014
%Y A246757 Subsequence of A007602.
%K A246757 nonn,base
%O A246757 1,1
%A A246757 _Max Alekseyev_, Sep 02 2014