Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A112030
a(n) = (2 + (-1)^n) * (-1)^floor(n/2).
12
3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1, -3, -1, 3, 1
OFFSET
0,1
COMMENTS
The fractions A112031(n)/A112032(n) give the partial sums of a(n)/floor((n+4)/2).
Sum of the two Cartesian coordinates from the image of the point (2,1) after n 90-degree counterclockwise rotations about the origin. - Wesley Ivan Hurt, Jul 06 2013
FORMULA
a(n) = A010684(n+1) * (-1)^floor(n/2).
O.g.f.: (3+x)/(1+x^2). - R. J. Mathar, Jan 09 2008
MAPLE
A112030 := proc(n)
(2 + (-1)^n) * (-1)^floor(n/2) ;
end proc: # R. J. Mathar, Jul 09 2013
MATHEMATICA
LinearRecurrence[{0, -1}, {3, 1}, 100] (* Jean-François Alcover, Nov 24 2020 *)
PROG
(PARI) a(n)=[3, 1, -3, -1][n%4+1] \\ Charles R Greathouse IV, Aug 21 2011
(Python)
def A112030(n): return (3, 1, -3, -1)[n&3] # Chai Wah Wu, Jan 31 2023
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Reinhard Zumkeller, Aug 27 2005
STATUS
approved