A242601 Integers repeated twice in a canonical order.
0, 0, 1, 1, -1, -1, 2, 2, -2, -2, 3, 3, -3, -3, 4, 4, -4, -4, 5, 5, -5, -5, 6, 6, -6, -6, 7, 7, -7, -7, 8, 8, -8, -8, 9, 9, -9, -9, 10, 10, -10, -10, 11, 11, -11, -11, 12, 12, -12, -12, 13, 13, -13, -13, 14, 14, -14, -14, 15, 15, -15, -15, 16, 16, -16, -16, 17, 17, -17, -17, 18, 18, -18, -18, 19, 19, -19, -19, 20, 20, -20, -20
Offset: 0
Links
- G. Myerson and A. J. van der Poorten, Some problems concerning recurrence sequences, Amer. Math. Monthly 102 (1995), no. 8, 698-705.
- Index entries for linear recurrences with constant coefficients, signature (1,-2,2,-1,1)
Programs
-
Mathematica
LinearRecurrence[{1,-2,2,-1,1},{0,0,1,1,-1},90] (* Harvey P. Dale, Sep 03 2020 *)
Formula
O.g.f.: x^2/((1 + x^2)^2*(1-x)) = x^2/(1 - x + 2*x^2 - 2*x^3 + x^4 - x^5).
a(n) = a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-5), with a(0) = a(1) = 0, a(2) = a(3) = 1 and a(4) = -1. This is the sequence s(2,n) defined in a comment above.
a(n) = floor((n+2)/4)*(-1)^floor((n+2)/2), n >= 0.
Comments