OFFSET
1,2
EXAMPLE
For n=4 the first 8 positive triangular numbers are {1,3,6,10,15,21,28,36} == {1,3,2,2,3,1,0,0} (mod 4); the sum of the residues is 12, so a(4)=12.
For n=5 the first 5 positive triangular numbers are {1,3,6,10,15} == {1,3,1,0,0} (mod 5); the sum of the residues is 5, so a(5)=5.
MATHEMATICA
Riffle[Table[
Total[Table[
Mod[Table[(n (n + 1)/2), {n, 1, (2 y - 1)}], (2 y - 1)]]], {y, 1,
t}] , Table[
Total[Table[Mod[Table[(n (n + 1)/2), {n, 1, (4 l)}], (2 l)]]], {l,
1, t}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Tolga Kurt, Feb 22 2020
STATUS
approved