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.

Showing 1-1 of 1 results.

A278347 If n is even, a(n) = a(n/2 -1) - a(n/2 +1), and if n is odd, a(n) = a((n-1)/2) - a((n+1)/2), with a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 2, 1, 1, 0, -1, -1, -2, -1, -1, 0, -1, -1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 0, -1, -1, 0, -1, -1, 0, 1, 1, 0, -1, -1, -2, -1, -1, 0, 1, 1, 0, -1, -1, 0, -1, -1, 0, 1, 1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 2, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, -2, -1, -1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 0, -1, -1, 0, -1, -1, -2, -1, -1, 0
Offset: 1

Views

Author

Tristan Cam and Robert G. Wilson v, Nov 18 2016

Keywords

Comments

Not cyclic or periodic.
-3 < a(n) < 3, for all n < 10^8.
First occurrence of k beginning at -2: 18, 7, 3, 1, 12.
The distribution of a(n) in the first 10^8 terms: -2, 4166621; -1, 33333332; 0, 25000091; 1, 33333335 and 2, 4166621 or -2 1/24, -1 1/3, 0 1/4, 1 1/3 and 2 1/24.

Crossrefs

Cf. A277778.

Programs

  • Mathematica
    a[n_] := a[n] = If[ OddQ[n], a[(n - 1)/2] - a[(n + 1)/2], a[n/2 - 1] - a[n/2 + 1]]; a[1] = a[2] = 1; Array[a, 105]

Formula

a(1) = 1 and a(2) = 1. a(n) = a(n/2 -1) - a(n/2 +1) if n is even and a(n) = a((n-1)/2) - a((n+1)/2) if n is odd.
Showing 1-1 of 1 results.