OFFSET
1,2
COMMENTS
First two equal consecutive values for a(51) = a(52) = 1284.
EXAMPLE
a(30) = 429 because 30*31/2 = 465, the antidivisors of 30 are 4, 12, 20 and 465 - 4 - 12 - 20 = 429.
MAPLE
with(numtheory): P:=proc(q) local j, k, n, v; v:=[1];
for n from 2 to q do k:=0; j:=n; while j mod 2<>1 do k:=k+1; j:=j/2; od;
v:=[op(v), n*(n+1)/2-(sigma(2*n+1)+sigma(2*n-1)+sigma(n/2^k)*2^(k+1)-6*n-2)];
od; op(v); end: P(10^2);
PROG
(Python)
from sympy import divisor_sigma
def A378414(n): return 1 if n == 1 else (n*(n+13)>>1)+2-divisor_sigma((m:=n<<1)-1)-divisor_sigma(m+1)-(divisor_sigma(n>>(k:=(~n&n-1).bit_length()))<<k+1) # Chai Wah Wu, Dec 03 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava, Nov 25 2024
STATUS
approved