login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A339439
Number of n-digit numbers (in base 10) that are divisible by each of their nonzero digits.
0
1, 9, 23, 105, 614, 3826, 25373, 177247, 1288440, 9679469, 74720569, 590162149, 4753928352, 38956270302, 324107031605, 2733414294539, 23338817531394, 201537057920381, 1758534957457627, 15493080163102862, 137729286979112861, 1234692470638216407, 11155826203456047704
OFFSET
0,2
EXAMPLE
a(2) = 23: 10, 11, 12, 15, 20, 22, 24, 30, 33, 36, 40, 44, 48, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99.
PROG
(PARI)
C(digs, n, m)={my(v=vector(m)); v[1]=1; for(i=1, n, v=vector(m, j, sum(k=1, #digs, my(r=10^(i-1)*digs[k]%m); v[1+(j-1-r)%m]))); v}
a(n)={if(n==1, 10, my(m=lcm([2..9])); sumdiv(m, d, my(digs=select(t->t<=1||d%t==0, [0..9])); my(v=C(digs, n, m)-C(digs, n-1, m)); sum(i=1, m/d, if(gcd(m/d, i)==1, v[1+i*d%m]))))} \\ Andrew Howroyd, Dec 04 2020
CROSSREFS
Cf. A002796.
Sequence in context: A057453 A282761 A232612 * A266238 A066008 A101058
KEYWORD
nonn,base
AUTHOR
Phuc H. G. Trinh, Dec 04 2020
EXTENSIONS
Terms a(18) and beyond from Andrew Howroyd, Dec 04 2020
STATUS
approved