OFFSET
1,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 4, 0, -6, 0, 4, 0, -1).
FORMULA
a(n) = (n+1)/2 if n is odd, a(n) = (n/2)^3 otherwise;
a(n) = ((((-1)^(n+1))+1)/4)*(n+1) - ((((-1)^(n+1))-1)/16)*n^3;
g.f.: (x + x^2 - 2*x^3 + 4*x^4 + x^5 + x^6)/(1 - x^2)^4.
MATHEMATICA
Table[((((-1)^(n+1))+1)/4)(n+1)- ((((-1)^(n+1))-1)/16)n^3, {n, 64}]
Flatten[Table[{n, n^3}, {n, 30}]] (* or *) LinearRecurrence[{0, 4, 0, -6, 0, 4, 0, -1}, {1, 1, 2, 8, 3, 27, 4, 64}, 60] (* Harvey P. Dale, Mar 11 2018 *)
PROG
(Magma) &cat[ [ n, n^3 ]: n in [1..40] ]; // Vincenzo Librandi, Apr 21 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 18 2007
STATUS
approved