login
Integers repeated twice in a canonical order.
1

%I #25 Sep 03 2020 12:28:43

%S 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,

%T -7,-7,8,8,-8,-8,9,9,-9,-9,10,10,-10,-10,11,11,-11,-11,12,12,-12,-12,

%U 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

%N Integers repeated twice in a canonical order.

%C This is the second member (k=2) of a k-family of sequences, call them s(k,n) for k = 1, 2, ... and n = 0, 1, ..., with o.g.f. G(k,x) = x^k/((1 + x^k)^2*(1 - x)) = x^k/(1 - x + 2*x^k - 2*x^(k+1) + x^(2*k) - x^(2*k+1)) and the recurrence s(k,n) = s(k,n-1) - 2*s(k,n-k) + 2*s(k,n-k-1) - s(k,n-2*k) + s(k,n-(2*k+1)) with input s(k,n) = 0 if n = 0, 1, ...., k-1, s(k,n) = 1 if n = k, k+1, ..., 2*k-1 and s(k,n) = -1 if n = 2*k. See the Myerson-van der Poorten link, p. 4.

%C If one prefers the negative integers to precede the positive ones the o.g.f. is -G(k,x).

%H G. Myerson and A. J. van der Poorten, <a href="https://www.jstor.org/stable/2974639">Some problems concerning recurrence sequences</a>, Amer. Math. Monthly 102 (1995), no. 8, 698-705.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,-2,2,-1,1)

%F 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).

%F 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.

%F a(n) = floor((n+2)/4)*(-1)^floor((n+2)/2), n >= 0.

%t LinearRecurrence[{1,-2,2,-1,1},{0,0,1,1,-1},90] (* _Harvey P. Dale_, Sep 03 2020 *)

%Y Cf. A001057, A242602, A002265 (unsigned version with two additional leading zeros).

%K sign,easy

%O 0,7

%A _Wolfdieter Lang_, Jun 17 2014