OFFSET
1,1
COMMENTS
a(n) is also the volume (and the number of cubes) in the n-th level (starting from the top) of the stepped pyramid described in A294630.
Number of terms less than 10^k, k=1,2,3,...: 1, 5, 19, 61, 195, 623, 1967, 6225, ... - Muniru A Asiru, Mar 04 2018
LINKS
Iain Fox, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
Illustration of initial terms (n = 1..6):
. _ _ _ _ _ _
. _ _ _ _ _| | |_
. _ _ _ _ _| | |_ | | |
. _ _ | | | | _|_ | | _|_ |
. |_|_| |_ _|_ _| |_ _| |_ _| |_ _ _| |_ _ _|
. |_|_| | | | | |_ _| | | |_ _| |
. |_ _|_ _| |_ | _| | | |
. 4 |_ _|_ _| |_ | _|
. 16 |_ _ _|_ _ _|
. 28
. 56
.
. _ _ _ _ _ _ _ _
. _ _ _ _ _ _ _| | |_
. | | | _| | |_
. _ _| | |_ _ | | |
. | _ _|_ _ | | _|_ |
. | | | | | _| |_ |
. |_ _ _| |_ _ _| |_ _ _ _| |_ _ _ _|
. | | | | | |_ _| |
. | |_ _ _ _| | | |_ _| |
. |_ _ | _ _| | | |
. | | | |_ | _|
. |_ _ _|_ _ _| |_ | _|
. |_ _ _ _|_ _ _ _|
. 68
. 120
.
Note that for n >= 2 the structure has a hole (or hollow) in the center.
a(n) is the number of ON cells in the n-th diagram.
MAPLE
with(numtheory): seq(sum(8*(sigma(k)-k+(1/2)), k=1..n), n=1..1000); # Muniru A Asiru, Mar 04 2018
MATHEMATICA
f[n_] := 8 (DivisorSigma[1, n] - n) + 4; Accumulate@Array[f, 56] (* Robert G. Wilson v, Dec 12 2017 *)
PROG
(PARI) a(n) = 4*(sum(k=1, n, n\k*k) - sum(k=2, n, n%k)) \\ Iain Fox, Dec 10 2017
(PARI) first(n) = my(res = vector(n)); res[1] = 4; for(x=2, n, res[x] = res[x-1] + 8*(sigma(x) - x + (1/2))); res; \\ Iain Fox, Dec 10 2017
(GAP) List([1..1000], n->Sum([1..n], k->8*(Sigma(k)-k+(1/2)))); # Muniru A Asiru, Mar 04 2018
(Python)
from math import isqrt
def A294629(n): return -(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1, s+1))-n**2<<2 # Chai Wah Wu, Oct 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Nov 05 2017
STATUS
approved