OFFSET
1,1
COMMENTS
a(n) is also the sum of all divisors of all positive integers <= n, plus the n-th oblong number, since A024916(n) equals the total area of the horizontal terraces of the stepped pyramid with n levels, and A002378(n) equals the total area of the vertical sides that are visible (see link).
a(n) is also the sum of all aliquot divisors of all positive integers <= n, plus the n-th triangular matchstick number.
LINKS
Omar E. Pol, Perspective view of the pyramid with 16 levels, contains 492 cells.
FORMULA
a(n) = A328366(n)/2. - Omar E. Pol, Apr 22 2020
a(n) = c * n^2 + O(n*log(n)), where c = zeta(2)/2 + 1 = A072691 + 1 = 1.822467... . - Amiram Eldar, Mar 21 2024
EXAMPLE
For n = 3 the areas of the terraces of the first three levels starting from the top of the stepped pyramid are 1, 3 and 4 respectively. On the other hand the areas of the vertical sides that are visible are [1, 1], [2, 2], [2, 1, 1, 2], or in successive levels 2, 4, 6 respectively. Hence the total area that is visible is equal to 1 + 3 + 4 + 2 + 4 + 6 = 8 + 12 = 20, so a(3) = 20.
For n = 16 the total number of horizontal and vertical cells that are visible are 220 and 272 respectively. So a(16) = 220 + 272 = 492 (see the link).
MATHEMATICA
Accumulate[Table[DivisorSigma[1, n] + 2*n, {n, 1, 50}]] (* Amiram Eldar, Mar 21 2024 *)
PROG
(PARI) a(n) = sum(k=1, n, n\k*k) + n*(n+1); \\ Michel Marcus, Jun 21 2018
(Python)
from math import isqrt
def A299692(n): return n*(n+1)+(-(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1, s+1))>>1) # Chai Wah Wu, Oct 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Mar 06 2018
STATUS
approved