OFFSET
1,5
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..1000
EXAMPLE
Antidivisors of 17 are 2, 3, 5, 7, 11, whose sum is 28.
Then, 28 mod 2 + 28 mod 3 + 28 mod 5 + 28 mod 7 + 28 mod 11 = 0 + 1 + 3 + 0 + 6 = 10.
MAPLE
P:=proc(q) local a, b, c, k, n; c:=[]; for n from 1 to q do a:=[]; for k from 2 to n-1 do
if abs((n mod k)-k/2)<1 then a:=[op(a), k]; fi; od; b:=add(k, k=a); c:=[op(c), add(b mod k, k=a)];
od; op(c); end: P(10^2);
MATHEMATICA
Table[Function[{s, t}, Sum[Mod[t, s[[i]] ], {i, Length[s]}]] @@ {#, Total[#]} &@ Select[Range[2, n - 1], Abs[Mod[n, #] - #/2] < 1 &], {n, 73}] (* Michael De Vlieger, Oct 15 2025 *)
PROG
(PARI) isad(x, n) = if (n%x, if (x%2, !((2*n-1)%x) || !((2*n+1)%x), !((2*n)%x)));
adrow(n) = select(x->isad(x, n), [2..n-1]); \\ A130799
a(n) = my(v=adrow(n), s=vecsum(v)); sum(k=1, #v, s % v[k]); \\ Michel Marcus, Oct 15 2025
(Python)
from sympy.ntheory.factor_ import antidivisors
def a(n):
ad = antidivisors(n)
sad = sum(ad)
return sum(sad%d for d in ad)
print([a(n) for n in range(1, 74)]) # Michael S. Branicky, Oct 18 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava, Oct 14 2025
STATUS
approved
