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!)
A135692 a(n) = a(n-2) - 2*( a(floor(n/2)) - a(abs(floor(n/2) - 1)) ) if (n mod 2) = 0, otherwise a(n-1) - 2*( a(abs(floor(n/2) - 2)) - a(abs(floor(n/2) - 3)) ), with a(0) = 0, a(1) = 1, a(2) = -2, a(3) = -4. 4
0, 1, -2, -4, 4, 6, 8, 6, -8, -2, -12, -8, -16, -32, -12, -16, 16, 12, 4, 8, 24, 52, 16, 4, 32, 52, 64, 56, 24, 40, 32, 64, -32, -72, -24, -16, -8, -72, -16, -8, -48, -32, -104, -112, -32, -64, -8, -64, -64, 8, -104, -80, -128, -184, -112, -152, -48, -72, -80, -64, -64, 0, -128, -160, 64, 80, 144, 80, 48, 240, 32, 112, 16, -80 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = a(n-2) - 2*( a(floor(n/2)) - a(abs(floor(n/2) - 1)) ) if (n mod 2) = 0, otherwise a(n-1) - 2*( a(abs(floor(n/2) - 2)) - a(abs(floor(n/2) - 3)) ), with a(0) = 0, a(1) = 1, a(2) = -2, a(3) = -4.
MATHEMATICA
a[n_]:= a[n]= If[n<2, n, If[n<4, -2^(n-1), If[Mod[n, 2]==0, a[n-2] - 2*( a[Floor[n/2]] - a[Abs[Floor[n/2] -1]]), a[n-1] - 2*(a[Abs[Floor[n/2] -2]] - a[Abs[Floor[n/2] -3]]) ]]];
Table[a[n], {n, 0, 80}]
PROG
(Sage)
@CachedFunction
def A135692(n):
if (n<2): return n
elif (n<4): return -2^(n-1)
elif (n%2==0): return A135692(n-2) - 2*(A135692(n//2) - A135692(abs(n//2 -1)))
else: return A135692(n-1) - 2*(A135692(abs(n//2 -2)) - A135692(abs(n//2 -3)))
[A135692(n) for n in (0..80)] # G. C. Greubel, Nov 24 2021
(PARI) See links.
CROSSREFS
Sequence in context: A038669 A288573 A288574 * A089003 A132118 A221952
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Feb 21 2008
EXTENSIONS
Edited by G. C. Greubel, Nov 24 2021
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:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)