[seqfan] Numbers that are divisible by the product of their digits

David Corneth davidacorneth at gmail.com
Sat Jun 10 13:12:24 CEST 2017


Interesting sequence. I have an approach to work on this problem. Maybe you
considered it. Hopefully it helps. I'll try to explain with a few examples.

If a number is divisible by its product of digits then we know the product
of digits is in A002473 <https://oeis.org/A002473>, the 7-smooth numbers
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, 28,
...), though we can't have them divisible by 10.

We can pick such a term and compute its factorizations into single digit
(in base 10) factors. For 12 that gives 2*2*3, 3*4, 2*6. 12 itself doesn't
count as at least one factor (12) has more than 1 digit.
If we seek terms of A007602 (as in the title) up to n digits we check
permutations of digits each of 126, 134, 223, 1126, 1134, 1223, 11126,
11134, 11223, 111126, 111134, 111223, ..., {n-3 ones} with 223.

Inspection shows that permutations of digits of 26 with ones is divisible
when ending in 12 or 16. Permutations of digits ending of 34 with ones are
never divisible by 12.
 Permutations of 223 with ones are sometimes divisible by 12. It must end
in 12 or 32 and have 3k + 1 ones. You could do similar analysis.

If the product is 7 then there's one factorization; 7. gcd(7, 10) = 1.
Computing 10^m mod 7 for m = 0, 1, 2, ..., 6 gives 1, 3, 2, 6, 4, 5, 1,
which can be used to show that (about) 1 in 7 of numbers containing one
digit 7 and all others 1 is divisible by 7.

Maybe it'd be nice to add sequence: a(n) is number of terms in A007602
having at most n digits. It would start
9,14,34,74,191,476,1223,3174,8403,...
These numbers are from the b-file in A007602. Finding them myself takes
long; 18 mins to find a(8) by checking all positive integers upto 10^8-1,
and some 12 mins with my prog so far.

We might also add:
T(n, k) denotes number of integers with at most n digits having product of
digits A002473(k) where 1 <= k <= c where A002473(c) is the largest number
having n digits. That sequence has a lot of zeroes though.

Maybe also: a(n) is the least integer having product of digits A002473(n).
Though we already have A068189 (Smallest positive number whose product of
digits equals n, or a(n)=0 if no such number exists, e.g. when n has
prime-factor larger than 7.).

For now I'm optimizing my prog in PARI. It check way too much permutations.
As you mentioned, numbers with 2 threes can only have 9k + 3 ones. I check
all k ones. Furthermore, if the product of digits is even, then the choices
for the last digits are restricted.



Though I've not completed my quest, I figured I'd post this now. Any ideas?


Best,
David



More information about the SeqFan mailing list