OFFSET
1,2
COMMENTS
Normal undulating integers are in A355301.
EXAMPLE
44 has 6 divisors: {1, 2, 4, 11, 22, 44} of which 3 are not normal undulating integers: {11, 22, 44}, hence a(44) = 6 - 3 = 3.
MATHEMATICA
nuQ[n_] := AllTrue[(s = Sign[Differences[IntegerDigits[n]]]), # != 0 &] && AllTrue[Differences[s], # != 0 &]; a[n_] := DivisorSum[n, 1 &, nuQ[#] &]; Array[a, 100] (* Amiram Eldar, Jun 29 2022 *)
PROG
(PARI) isok(m) = if (m<10, return(1)); my(d=digits(m), dd = vector(#d-1, k, sign(d[k+1]-d[k]))); if (#select(x->(x==0), dd), return(0)); my(pdd = vector(#dd-1, k, dd[k+1]*dd[k])); #select(x->(x>0), pdd) == 0; \\ A355301
a(n) = sumdiv(n, d, isok(d)); \\ Michel Marcus, Jun 30 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jun 29 2022
STATUS
approved