OFFSET
1,2
COMMENTS
The pairs of adjacent divisors of n are counted in A062799(n).
For each divisor d of n we can check in how many pairs it occurs. For each prime divisor p of n, see the exponent of p in the factorization of d. If it's positive (p|d) then it occurs once more. If d*p doesn't divide n, add one to the frequency as well. - David A. Corneth, Dec 17 2018
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(n) = Sum_{d|n} d*Sum_{p|d} (1 + 1/p) where p is restricted to primes.
a(n) = A323599(n) + A329354(n) = A323599(n) + A328260(n) + A329375(n). - Antti Karttunen, Nov 15 2019
a(p^k) = (p^k - 1)*(p + 1)/(p - 1).
a(p_1*p_2*...*p_m) = m*(p_1 + 1)*(p_2 + 1)*...*(p_m + 1).
a(p*q^k) = (p + 1)*(2*q^k + 3*q^(k - 1) + 3*q^(k - 2) + ... + 3*q + 2).
a(p*q*r^k) = (p + 1)*(q + 1)*(3*r^k + 4*r^(k - 1) + 4*r^(k - 2) + ... + 4*r + 3) and similar for a larger number of distinct prime factors of n.
EXAMPLE
a(4) = (1 + 2) + (2 + 4) = 9.
a(120) = a(3*5*2^3) = 4*6*(3*8 + 4*4 + 4*2 + 3) = 1224.
MATHEMATICA
divisorSumPrime[n_] := DivisorSum[n, 1+1/# &, PrimeQ[#] &]; a[n_] := DivisorSum[n, #*divisorSumPrime[#]& ]; Array[a, 70] (* Amiram Eldar, Dec 17 2018 *)
PROG
(PARI) a(n) = sumdiv(n, d, d*sumdiv(d, p, isprime(p)*(1+1/p))); \\ Michel Marcus, Dec 17 2018
(PARI) a(n) = my(f = factor(n), res = 0); fordiv(n, d, for(i = 1, #f~, v = valuation(d, f[i, 1]); res+=(d * ((v > 0) + (v < f[i, 2]))))); res \\ David A. Corneth, Dec 17 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Shevelev, Aug 20 2010
EXTENSIONS
Definition rephrased, entries checked, one example added. - R. J. Mathar, Oct 25 2010
STATUS
approved