login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
LINKS
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
Sequence in context: A063062 A066056 A153284 * A010684 A176040 A125768
KEYWORD
sign,easy
AUTHOR
Reinhard Zumkeller, Aug 27 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 15:37 EDT 2024. Contains 372197 sequences. (Running on oeis4.)