login
A339915
Number of divisors of n with the same number of decimal digits as n.
0
1, 2, 2, 3, 2, 4, 2, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 3, 1, 3, 1, 3, 2, 2, 1, 4, 1, 3, 2, 3, 1, 3, 2, 3, 2, 2, 1, 6, 1, 2, 2, 3, 2, 4, 1, 3, 2, 4, 1, 5, 1, 2, 3, 3, 2, 4, 1, 5, 2, 2, 1, 6, 2, 2, 2, 4, 1, 6, 2, 3, 2
OFFSET
1,2
FORMULA
a(n) = Sum_{d|n} [floor(log_10(d)) = floor(log_10(n))], where [ ] is the Iverson bracket.
EXAMPLE
a(20) = 2; The only divisors of 20 that have the same number of digits as 20 are 10 and 20, so a(20) = 2.
MATHEMATICA
Table[Sum[KroneckerDelta[Floor[Log10[i]], Floor[Log10[n]]] (1 - Ceiling[n/i] + Floor[n/i]), {i, n}], {n, 100}]
PROG
(PARI) a(n) = sumdiv(n, d, #Str(d) == #Str(n)); \\ Michel Marcus, Dec 22 2020
CROSSREFS
Sequence in context: A083903 A327536 A341946 * A306509 A083867 A076888
KEYWORD
nonn,base
AUTHOR
Wesley Ivan Hurt, Dec 22 2020
STATUS
approved