OFFSET
1,2
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{n=2..1023} 1/A009995(n) = 3.89840673699905364734... (this is a rational number whose numerator and denominator have 1292 and 1291 digits, respectively). - Amiram Eldar, Jan 06 2024
EXAMPLE
22 has 4 divisors {1, 2, 11, 22} of which two have decimal digits that are not in strictly decreasing order: {11, 22}, hence a(22) = 4-2 = 2.
52 has 6 divisors {1, 2, 4, 13, 26, 52} of which four have decimal digits that are in strictly decreasing order {1, 2, 4, 52}, hence a(52) = 4.
MAPLE
f:= proc(n) local L;
if n < 10 then return true fi;
L:= convert(n, base, 10);
andmap(type, L[2..-1]-L[1..-2], positive)
end proc:
g:= n -> nops(select(f, numtheory:-divisors(n))):
map(g, [$1..100]); # Robert Israel, Oct 31 2022
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, Max @ Differences @ IntegerDigits[#] < 0 &]; Array[a, 100] (* Amiram Eldar, Oct 29 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, my(dd=digits(d)); vecsort(dd, , 12) == dd); \\ Michel Marcus, Oct 30 2022
(Python)
from sympy import divisors
def c(n): s = str(n); return all(s[i+1] < s[i] for i in range(len(s)-1))
def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Feb 12 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 29 2022
STATUS
approved