OFFSET
1,2
COMMENTS
Number of divisors of n plus the sum of all the remainders modulo the numbers below n.
EXAMPLE
a(1) = 1 + 0 = 1;
a(2) = 2 + 0 = 2;
a(3) = 2 + 1 = 3;
a(4) = 3 + 1 = 4;
a(5) = 2 + 4 = 6.
MAPLE
A004125 := proc(n) add( modp(n, k), k=2..n) ; end: A163180 := proc(n) numtheory[tau](n)+A004125(n) ; end: seq(A163180(n), n=1..80) ; # R. J. Mathar, Jul 27 2009
MATHEMATICA
Table[DivisorSigma[0, n]+Sum[Mod[n, k], {k, n}], {n, 70}] (* Harvey P. Dale, Feb 11 2015 *)
PROG
(Python)
from math import isqrt
from sympy import divisor_count
def A163180(n): return divisor_count(n)+n**2+((s:=isqrt(n))**2*(s+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1, s+1))>>1) # Chai Wah Wu, Oct 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jul 22 2009
EXTENSIONS
169 inserted by R. J. Mathar, Jul 27 2009
STATUS
approved