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!)
A135564 a(n) defined by a(2*n) = a(2*n-2) - (a(n) - 2*a(n-1) + a(n-2)) for n > 2, a(2*n+1) = a(2*n) - (a(n-2) - 2*a(n-3) + a(n-4)), for n > 3, with a(0)=0, a(1)=1, a(2)=3, a(3)=-1, a(4)=-2, a(5)=-3, a(6)=4, a(7)=2. 1
0, 1, 3, -1, -2, -3, 4, 2, 1, 0, 1, 7, -7, -10, 2, 2, 1, -7, 1, 10, -1, -2, -6, -6, 14, 12, 3, -2, -12, 8, 0, -11, 1, -14, 8, 20, -8, -7, -9, -2, 11, -5, 1, 0, 4, 24, 0, -10, -20, -17, 2, -2, 9, -11, 5, 27, 10, 17, -20, -24, 8, 13, 11, -19, -12, 16, 15, 18, -22, -45, -12, 15, 28, -9, -1, 9, 2, 42, -7, -36, -13, -10, 16, 7, -6, -12, 1, 30, -4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = a(n-2) - (a(floor(n/2)) - 2*a(abs(floor(n/2) -1)) + a(abs(floor(n/2) -2)) ) if (n mod 2) = 0, otherwise a(n-1) - (a(abs(floor(n/2) - 2)) - 2*a(abs(floor(n/2) - 3)) + a(abs(floor(n/2) - 4)).
a(2*n) = a(2*n-2) - (a(n) - 2*a(n-1) + a(n-2)), for n > 2.
a(2*n+1) = a(2*n) - (a(n-2) - 2*a(n-3) + a(n-4)), for n > 3.
MATHEMATICA
a[0]:=0; a[1]:=1; a[2]:=3; a[3]:=-1; a[4]:=-2; a[5]:=-3; a[6]:=4; a[7]:=2;
a[n_]:= a[n]= If[Mod[n, 2]==0, a[n-2] -a[n/2] +2*a[n/2 -1] -a[n/2 -2], a[n-1] -a[(n-1)/2 -2] +2*a[(n-1)/2 -3] -a[(n-1)/2 -4]];
Table[a[n], {n, 0, 100}]
PROG
(Sage)
@CachedFunction
def a(n): # A135564
if (n<8): return [0, 1, 3, -1, -2, -3, 4, 2][n]
elif ((n%2)==0): return a(n-2) - a(n/2) + 2*a(n/2 - 1) - a(n/2 -2)
else: return a(n-1) - a((n-1)/2 - 2) + 2*a((n-1)/2 - 3) - a((n-1)/2 -4)
[a(n) for n in (0..100)] # G. C. Greubel, Nov 26 2021
CROSSREFS
Sequence in context: A211948 A021766 A286357 * A110063 A260313 A050056
KEYWORD
sign,easy,less
AUTHOR
Roger L. Bagula, Feb 23 2008
EXTENSIONS
Edited by G. C. Greubel, Nov 28 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 14 16:33 EDT 2024. Contains 371666 sequences. (Running on oeis4.)