login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A290561
a(n) = n + cos(n*Pi/2).
2
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,4
COMMENTS
a(n) divides A289296(n).
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)
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}]
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved