OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-2,1).
FORMULA
a(n) = 3n^2+1 if n == 0 (mod 4), 3n^2 otherwise.
a(n) = (1+(-1)^n+(-i)^n+i^n+12*n^2)/4 where i=sqrt(-1). - Colin Barker, Jul 04 2014
G.f.: -(3*x^5+6*x^4+6*x^3+7*x^2+x+1) / ((x-1)^3*(x+1)*(x^2+1)). - Colin Barker, Jul 04 2014
EXAMPLE
a(2)=12 since the cube roots of 4, 5, 6, ..., 15 all lie between 1.5 and 2.5.
MAPLE
seq(1 + floor((n+1/2)^3) - ceil((n-1/2)^3), n = 0 .. 100);
MATHEMATICA
Table[SeriesCoefficient[-(3 x^5 + 6 x^4 + 6 x^3 + 7 x^2 + x + 1)/((x - 1)^3 (x + 1) (x^2 + 1)), {x, 0, n}], {n, 0, 46}] (* Michael De Vlieger, Dec 24 2015 *)
LinearRecurrence[{2, -1, 0, 1, -2, 1}, {1, 3, 12, 27, 49, 75}, 50] (* Vincenzo Librandi, Dec 25 2015 *)
PROG
(PARI) Vec(-(3*x^5+6*x^4+6*x^3+7*x^2+x+1)/((x-1)^3*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Jul 04 2014
(Magma) [n mod 4 eq 0 select 3*n^2+1 else 3*n^2: n in [0..80]]; // Vincenzo Librandi, Dec 25 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Nov 22 2000
STATUS
approved