

A336857


The digit sum of n*(n^2 + 1)/2.


0



1, 5, 6, 7, 11, 3, 13, 8, 18, 10, 14, 15, 7, 20, 21, 13, 17, 18, 19, 5, 15, 16, 20, 21, 22, 17, 27, 19, 14, 15, 16, 11, 30, 31, 17, 18, 19, 23, 33, 7, 20, 21, 31, 17, 27, 28, 23, 15, 34, 20, 21, 13, 26, 36, 19, 32, 24, 34, 20, 12, 13, 26, 18, 10, 23, 24, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS



FORMULA



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



STATUS

approved



