OFFSET
1,2
LINKS
Felix Fröhlich, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n*(n+1)/2 - Sum_{k=1..n} (1 - ceiling(n/k^2) + floor(n/k^2)) * k.
a(n) = n*(n+1)/2-sigma(sqrt(n/A007913(n)) = A000217(n)-A000203(sqrt(n/A007913(n)). - Chai Wah Wu, Jan 31 2021
EXAMPLE
a(3) = 5; 1^1|3, but 2^2 and 3^2 do not. Then 2 + 3 = 5.
a(4) = 7; 1^2|4 and 2^2|4, but 3^2 and 4^2 do not. Then 3 + 4 = 7.
MATHEMATICA
Table[Sum[k (Ceiling[n/k^2] - Floor[n/k^2]), {k, n}], {n, 80}]
PROG
(PARI) a(n) = sum(k=1, n, if (n % k^2, k)); \\ Michel Marcus, Jan 31 2021
(Python)
from sympy import divisor_sigma, integer_nthroot
from sympy.ntheory.factor_ import core
def A338231(n):
return n*(n+1)//2-divisor_sigma(integer_nthroot(n//core(n, 2), 2)[0]) # Chai Wah Wu, Jan 31 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 30 2021
STATUS
approved