OFFSET
1,2
LINKS
Eric Weisstein's World of Mathematics, Sum of prime factors
Eric Weisstein's World of Mathematics, Triangular number
FORMULA
EXAMPLE
a(4) = 7; the 4th triangular number is 10, the prime factors of 10 are 2 and 5, and 2+5 = 7.
a(6) = 10; the 6th triangular number is 21, the prime factors of 21 are 3 and 7, and 3+7 = 10.
MATHEMATICA
a[1]=0; a[n_] := Plus @@ Times @@@ FactorInteger[n (n+1)/2]; Array[a, 80] (* Giovanni Resta, Jun 12 2016 *)
Join[{0}, Rest[Total[Times@@@FactorInteger[#]]&/@Accumulate[Range[100]]]] (* Harvey P. Dale, May 06 2024 *)
PROG
(PARI) a(n) = my(f=factor(n*(n+1)/2)); sum(i=1, matsize(f)[1], f[i, 1]*f[i, 2]) \\ David A. Corneth, Jun 12 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Luca Pezzullo, Jun 11 2016
EXTENSIONS
a(30) and a(38) corrected by Giovanni Resta, Jun 12 2016
STATUS
approved