OFFSET
1,3
COMMENTS
Sum of all proper nondivisors of all positive integers <= n. - Omar E. Pol, Feb 11 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{k=1..n} Sum_{i=1..k-1} (n-k-i+1) mod (n-i+1). - Wesley Ivan Hurt, Sep 13 2017
G.f.: x/(1 - x)^4 - (1/(1 - x))*Sum_{k>=1} k*x^k/(1 - x^k). - Ilya Gutkovskiy, Sep 18 2017
EXAMPLE
a(5) = antisigma(1) + ... + antisigma(5) = 0 + 0 + 2 + 3 + 9 = 14.
MATHEMATICA
l = {}; s = 0; Do[s = s + (n (n + 1) / 2) - DivisorSigma[1, n]; l = Append[l, s], {n, 1, 100}]; l
Accumulate[Table[Total[Complement[Range[n], Divisors[n]]], {n, 50}]] (* Harvey P. Dale, May 19 2014 *)
PROG
(PARI) a(n) = sum(k=1, n, k*(k+1)/2-sigma(k)); \\ Michel Marcus, Sep 18 2017
(Python)
from math import isqrt
def A076664(n): return n*(n+1)*(n+2)//3+(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,easy
AUTHOR
Joseph L. Pe, Oct 24 2002
STATUS
approved