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.

A290561 a(n) = n + cos(n*Pi/2).

Original entry on oeis.org

1, 1, 1, 3, 5, 5, 5, 7, 9, 9, 9, 11, 13, 13, 13, 15, 17, 17, 17, 19, 21, 21, 21, 23, 25, 25, 25, 27, 29, 29, 29, 31, 33, 33, 33, 35, 37, 37, 37, 39, 41, 41, 41, 43, 45, 45, 45, 47, 49, 49, 49, 51, 53, 53, 53, 55, 57, 57, 57, 59, 61, 61, 61, 63, 65, 65, 65
Offset: 0

Views

Author

Keywords

Comments

a(n) divides A289296(n).

Crossrefs

Programs

  • Maple
    A290561:=n->n+cos(n*Pi/2): seq(A290561(n), n=0..150); # Wesley Ivan Hurt, Aug 06 2017
  • Mathematica
    a[n_] := n + Cos[n*Pi/2]; Table[a[n], {n, 0, 60}]
  • PARI
    a(n) = n + round(cos(n*Pi/2)); \\ Michel Marcus, Aug 06 2017
    
  • PARI
    Vec((x^3 + x^2 - x + 1)/((x - 1)^2*(x^2 + 1)) + O(x^100)) \\ Colin Barker, Aug 06 2017

Formula

G.f.: (x^3 + x^2 - x + 1)/((x - 1)^2*(x^2 + 1)).
a(n) = n if n == 3 (mod 4), and a(n) = a(n-4) + 4 otherwise, for n>2.
a(n) = a(n+20) - 20.
a(n) = 2*A004524(n) + 1.
a(n) + A290562(n) = 2*n.
a(n) * A290562(n) = n^2 - cos(n*Pi/2)^2 = A085046(n) for n>0.
A290562(n) = -a(-n).
From Colin Barker, Aug 06 2017: (Start)
a(n) = ((-i)^n + i^n)/2 + n where i=sqrt(-1).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>3. (End)