A119713 First differences are 2, 5, 5, 9, 9, 9, 14, 14, 14, 14, ..., that is, A000096 with m-th term repeated m times (m>=1).
0, 2, 7, 12, 21, 30, 39, 53, 67, 81, 95, 115, 135, 155, 175, 195, 222, 249, 276, 303, 330, 357, 392, 427, 462, 497, 532, 567, 602, 646, 690, 734, 778, 822, 866, 910, 954, 1008, 1062, 1116, 1170, 1224, 1278, 1332, 1386, 1440, 1505, 1570, 1635, 1700, 1765, 1830
Offset: 0
Keywords
References
- David Pagni, Building buildings with triangular numbers, AMATYC Review (vol. 27 no. 2 spring 2006, pp. 56-65).
Programs
-
Mathematica
a = 10; lst = {0}; s = 0; t = Flatten@ Table[ Table[n*(n + 3)/2, {n}], {n, a}]; Do[ AppendTo[lst, s = s + t[[n]]], {n, a(a+1)/2}]; lst (* Robert G. Wilson v, Jun 16 2006 *)
-
Python
from math import isqrt def A119713(n): return (r:=(m:=isqrt(k:=n<<1))+(k>m*(m+1)))*(12*n+r*((n<<2)-r*(r+2)+1)+2)>>3 # Chai Wah Wu, Nov 08 2024
Formula
a(n) = m(12n+m(4n-m(m+2)+1)+2)/8 where m = A002024(n). - Chai Wah Wu, Nov 08 2024
Extensions
More terms from Robert G. Wilson v, Jun 16 2006