A378414 Sum of the integers from 1 to n that are not antidivisors of n.
1, 3, 4, 7, 10, 17, 18, 28, 37, 41, 54, 65, 72, 89, 102, 122, 125, 143, 172, 186, 209, 217, 242, 277, 286, 327, 336, 360, 411, 429, 454, 470, 513, 565, 578, 634, 653, 671, 728, 765, 820, 837, 890, 950, 949, 1023, 1068, 1120, 1153, 1195, 1284, 1284, 1343, 1433
Offset: 1
Examples
a(30) = 429 because 30*31/2 = 465, the antidivisors of 30 are 4, 12, 20 and 465 - 4 - 12 - 20 = 429.
Programs
-
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);
-
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()))<
Chai Wah Wu, Dec 03 2024
Comments