OFFSET
1,6
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) > 0 for all numbers n > 2 since n in base b = n-1 is 11.
a(n) > 1 for all even numbers > 4 since n in base b = n-2 is 12. Similarly, a(n) > 1 for all composite numbers > 4 since if n = k*m, then n is divisible by its product of digits in bases n-m and n-k.
a(p) > 1 for primes p in A085104.
a(p) > 2 for primes p in A119598 (i.e., 31, 8191, ...).
a(n) >= A088323(n), with equality if n = 4 or if n is a prime.
EXAMPLE
a(3) = 1 since 3 is divisible by its product of digits only in base 2: 3 = 11_2 and 1*1 | 3.
a(6) = 2 since 6 is divisible by its product of digits in 2 bases: in base 4, 6 = 12_4 and 1*2 | 6, and in base 5, 6 = 11_5 and 1*1 | 6.
MATHEMATICA
q[n_, b_] := (p = Times @@ IntegerDigits[n, b]) > 0 && Divisible[n, p]; a[n_] := Count[Range[2, n], _?(q[n, #] &)]; Array[a, 100]
PROG
(PARI) a(n) = sum(b=2, n-1, my(x=vecprod(digits(n, b))); x && !(n%x)); \\ Michel Marcus, Feb 12 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Feb 11 2021
STATUS
approved