|
|
A226940
|
|
a(0)=0; if a(n-1) is odd, a(n) = n + a(n-1), otherwise a(n) = n - a(n-1).
|
|
0
|
|
|
0, 1, 3, 6, -2, 7, 13, 20, -12, 21, 31, 42, -30, 43, 57, 72, -56, 73, 91, 110, -90, 111, 133, 156, -132, 157, 183, 210, -182, 211, 241, 272, -240, 273, 307, 342, -306, 343, 381, 420, -380, 421, 463, 506, -462, 507, 553, 600, -552, 601, 651, 702, -650, 703, 757
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
Index entries for linear recurrences with constant coefficients, signature (0,0,0,3,0,0,0,-3,0,0,0,1).
|
|
FORMULA
|
G.f.: x*(1 +3*x +6*x^2 -2*x^3 +4*x^4 +4*x^5 +2*x^6 -6*x^7 +3*x^8 +x^9)/((1-x)^3*(1+x)^3*(1+x^2)^3). [Bruno Berselli, Jul 01 2013]
|
|
MATHEMATICA
|
LinearRecurrence[{0, 0, 0, 3, 0, 0, 0, -3, 0, 0, 0, 1}, {0, 1, 3, 6, -2, 7, 13, 20, -12, 21, 31, 42}, 60] (* Bruno Berselli, Jul 01 2013 *)
|
|
PROG
|
(Magma) [IsZero(n) select 0 else IsOdd(Self(n)) select n+Self(n) else n-Self(n): n in [0..60]]; // Bruno Berselli, Jul 01 2013
(Maxima) makelist(coeff(taylor(x*(1+3*x+6*x^2-2*x^3+4*x^4+4*x^5+2*x^6-6*x^7+3*x^8+x^9)/((1-x)^3*(1+x)^3*(1+x^2)^3), x, 0, n), x, n), n, 0, 60); /* Bruno Berselli, Jul 01 2013 */
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|