A143101 Partial sums of A143097.
1, 3, 7, 10, 15, 22, 28, 36, 46, 55, 66, 79, 91, 105, 121, 136, 153, 172, 190, 210, 232, 253, 276, 301, 325, 351, 379, 406, 435, 466, 496, 528, 562, 595, 630, 667, 703, 741, 781, 820, 861, 904, 946, 990, 1036, 1081, 1128, 1177, 1225, 1275, 1327, 1378, 1431
Offset: 1
Examples
a(3) = 7 = T(3) + 1 since 3 == 0 mod 3 and T(3) = 6. a(4) = 10 = T(4) since 4 == 1 mod 3.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A143097 := proc(n) if(n<=1)then return n: elif(n mod 3 <= 1)then return n+1-2*(n mod 3): else return n: fi: end: A143101 := proc(n) option remember: if(n=0)then return 0:else return procname(n-1)+A143097(n):fi: end:seq(A143101(n),n=1..60); # Nathaniel Johnston, Apr 30 2011
-
Mathematica
With[{nn=70},Accumulate[Join[{1},Riffle[Rest[Select[Range[nn], !Divisible[ #,3]&]], Range[3,nn,3],3]]]] (* Harvey P. Dale, May 06 2012 *)
-
PARI
a(n)=n*(n+1)/2+if(n%3==0,1,0) \\ Luc Rousseau, Jun 18 2017
Formula
G.f.: x(1+x+2x^2-2x^3+x^4)/((1-x)^3(1+x+x^2)). [R. J. Mathar, Sep 06 2008]
Extensions
a(18) corrected by Nathaniel Johnston, Apr 30 2011