OFFSET
1,4
COMMENTS
Twice this sequence is an attempt to find a counterpart to A161664: both compare triangular numbers T(n) and partial sums of numbers of divisors S(n). A161664 computes the excess of T(n) compared to S(n), whereas 2*a(n) computes the excess of S(n') compared to T(n), where n' is chosen equal to floor((n+1)^2/4). This choice appears structurally natural and economical when illustrated in a diagram. (See provided link.)
LINKS
Luc Rousseau, Accompanying diagram
MATHEMATICA
F[n_] := Floor[(1/4)*n^2]
A[n_] := (Sum[DivisorSigma[0, k], {k, 1, F[n + 1]}] - n*(n + 1)/2)/2
Table[A[n], {n, 1, 100}]
PROG
(PARI)
f(n)=floor(n^2/4)
a(n)=(sum(k=1, f(n+1), numdiv(k))-n*(n+1)/2)/2
for(n=1, 100, print1(a(n), ", "))
(Python)
from math import isqrt
def A299251(n): return (-(s:=isqrt(m:=(n+1)**2>>2))**2-(n*(n+1)>>1)>>1)+sum(m//k for k in range(1, s+1)) # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Luc Rousseau, Feb 06 2018
STATUS
approved