cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A242601 Integers repeated twice in a canonical order.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Jun 17 2014

Keywords

Comments

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.
If one prefers the negative integers to precede the positive ones the o.g.f. is -G(k,x).

Crossrefs

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

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.