login
A076664
a(n) = Sum_{k=1..n} antisigma(k), where antisigma(i) = sum of the nondivisors of i that are between 1 and i.
5
0, 0, 2, 5, 14, 23, 43, 64, 96, 133, 187, 237, 314, 395, 491, 596, 731, 863, 1033, 1201, 1400, 1617, 1869, 2109, 2403, 2712, 3050, 3400, 3805, 4198, 4662, 5127, 5640, 6181, 6763, 7338, 8003, 8684, 9408, 10138, 10957, 11764, 12666, 13572, 14529, 15538
OFFSET
1,3
COMMENTS
Sum of all proper nondivisors of all positive integers <= n. - Omar E. Pol, Feb 11 2014
LINKS
FORMULA
a(n) = A000292(n) - A024916(n), n >= 1. Omar E. Pol, Feb 11 2014
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