OFFSET
1,2
MATHEMATICA
a[n_] := Plus @@ IntegerDigits[n*(n^2 + 1)/2]; Array[a, 100] (* Amiram Eldar, Aug 10 2020 *)
PROG
(Python)
def seq(num):
res = []
for i in range(1, num + 1):
res.append(calc(i))
return res
def calc(num):
sum = 0
start = int((num * (num - 1)) // 2) + 1
for i in range(start, start + num):
sum += i
recip = 0
for i in str(sum):
recip += int(i)
return recip
print(seq(260))
(PARI) a(n) = sumdigits(n*(n^2 + 1)/2) \\ Michel Marcus, Aug 10 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Páll Ivan Slamnig, Aug 05 2020
STATUS
approved