OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
D. H. Lehmer, Recurrence formulas for certain divisor functions, Bull. Amer. Math. Soc., Vol. 49, No. 2 (1943), pp. 150-156.
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = 3*A001318(n-1). - Michel Marcus, Apr 24 2016
From Colin Barker, Apr 24 2016: (Start)
a(n) = 3*(1-(-1)^n + 2*(-3+(-1)^n)*n + 6*n^2)/16.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 5.
G.f.: 3*x^2*(1+x+x^2) / ((1-x)^3*(1+x)^2).
(End)
E.g.f.: 3*(-1 - 2*x + exp(2*x) + 6*x^2*exp(2*x))*exp(-x)/16. - Ilya Gutkovskiy, Apr 24 2016
Sum_{n>=2} 1/a(n) = 2 - 2*Pi/(3*sqrt(3)). - Amiram Eldar, Mar 24 2021
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {0, 3, 6, 15, 21}, 50] (* G. C. Greubel, Jun 19 2017 *)
Select[Accumulate[Range[0, 100]], Divisible[#, 3]&] (* Harvey P. Dale, Feb 11 2018 *)
PROG
(PARI) lista(nn) = {for (i = 0, nn, t = i*(i+1)/2; if (t % 3 == 0, print1(t, ", "); )); } \\ Michel Marcus, Jun 01 2013
(PARI) concat(0, Vec(3*x^2*(1+x+x^2)/((1-x)^3*(1+x)^2) + O(x^50))) \\ Colin Barker, Apr 24 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), Apr 29 2006
STATUS
approved