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!)
A135689 a(n) = a(n-2) - (a(floor(n/2)) - a(abs(floor(n/2) - 1))) if (n mod 2 = 0), otherwise a(n-1) - (a(abs(floor(n/2) - 2)) - a(abs(floor(n/2) - 3))). 4
0, 1, -1, -2, 1, 2, 2, 1, -1, 1, -2, -1, -2, -5, -1, -2, 1, 1, -1, 0, 2, 4, 1, -1, 2, 5, 5, 4, 1, 2, 2, 5, -1, -5, -1, 0, 1, -2, 0, 0, -2, 0, -4, -5, -1, -3, 1, -1, -2, 1, -5, -3, -5, -8, -4, -7, -1, -1, -2, -1, -2, 1, -5, -6, 1, 1, 5, 2, 1, 7, 0, 4, -1, -5, 2, 1, 0, -1, 0, 3, 2, 0, 0, 0, 4, 6, 5, 3, 1, 5, 3, 4, -1, -5, 1, 3, 2, -2, -1, 1, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = a(n-2) - (a(floor(n/2)) - a(abs(floor(n/2) - 1))) if (n mod 2 = 0), otherwise a(n-1) - (a(abs(floor(n/2) - 2)) - a(abs(floor(n/2) - 3))).
MATHEMATICA
a[n_]:= a[n] = If[n<2, n, If[n<4, 1-n, If[Mod[n, 2]==0, a[n-2] - (a[Floor[n/2]] - a[Abs[Floor[n/2] -1]]), a[n-1] - (a[Abs[Floor[n/2] -2]] - a[Abs[Floor[n/2] - 3]])] ]]; Table[a[n], {n, 0, 110}]
PROG
(Sage)
def a(n): # A135689
if (n<4): return [0, 1, -1, -2][n]
elif ((n%2)==0): return a(n-2) - (a((n//2)) - a(abs((n//2) - 1)))
else: return a(n-1) - (a(abs((n//2) - 2)) - a(abs((n//2) - 3)))
[a(n) for n in (0..110)] # G. C. Greubel, Nov 26 2021
CROSSREFS
Sequence in context: A279362 A214841 A025917 * A029438 A304274 A081592
KEYWORD
sign,easy,less
AUTHOR
Roger L. Bagula, Feb 19 2008
EXTENSIONS
Edited by N. J. A. Sloane, Mar 03 2008
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 April 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)