OFFSET
1,2
LINKS
Guenther Schrack, Table of n, a(n) for n = 1..10010
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = n - 1 + ceiling((-3 + n^2)/2) if n > 1.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Joerg Arndt, Apr 02 2011
From Guenther Schrack, Jun 06 2018: (Start)
a(n) = (2*n^2 + 4*n - 9 + (-1)^n)/4 for n > 1.
a(n) = a(n-2) + 2*n for n > 3.
a(-n) = a(n-2) for n > 1.
a(n) = n - 1 + A047838(n) for n > 1. (End)
G.f.: x * (1 + x^2 + 2*x^3 - 2*x^4) / (1 - 2*x + 2*x^3 - x^4). - Michael Somos, Oct 28 2018
Sum_{n>=1} 1/a(n) = 8/3 + tan(sqrt(5)*Pi/2)*Pi/(2*sqrt(5)) - cot(sqrt(3/2)*Pi)*Pi/(2*sqrt(6)). - Amiram Eldar, Sep 16 2022
MAPLE
a:=n->n-1+ceil((-3+n^2)/2): 1, seq(a(n), n=2..60); # Muniru A Asiru, Aug 05 2018
MATHEMATICA
Table[n-1+Ceiling[(n*n-3)/2], {n, 60}] (* Vladimir Joseph Stephan Orlovsky, Apr 02 2011 *)
Join[{1}, LinearRecurrence[{2, 0, -2, 1}, {2, 5, 10, 15}, 52]] (* Ray Chandler, Jul 15 2015 *)
PROG
(GAP) a:=[2, 5, 10, 15];; for n in [5..60] do a[n]:=2*a[n-1]-2*a[n-3]+a[n-4]; od; a:=Concatenation([1], a); # Muniru A Asiru, Aug 05 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jan 07 2011
STATUS
approved