OFFSET
1,3
COMMENTS
Graph resembles that of Euler's totient function (A000010).
EXAMPLE
a(12) = floor(average of {12-1, 6-2, 4-3}) = 5.
a(16) = floor(average of {16-1, 8-2, 4-4}) = 7.
PROG
(Python)
from math import floor, ceil
from sympy import divisors
def a(n):
arr = divisors(n)
length = ceil(len(arr)/2)
total = 0
for i in range(length):
total += arr[-(i+1)] - arr[i]
avg = total / length
return floor(avg)
def main():
for i in range(1, 250):
print("{}, ".format(a(i)), end="")
(PARI) a(n) = my(v=divisors(n)); vecsum(abs(v-Vecrev(v))) \ (#v + #v%2); \\ Kevin Ryde, Mar 10 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Christoph B. Kassir, Mar 09 2022
STATUS
approved