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!)
A359368 Sequence begins 1, 1, 1; for even n > 3, a(n) = a(n/2 - 1) + a(n/2 + 1); for odd n > 3, a(n) = -a((n-1)/2). 1
1, 1, 1, 2, -1, 3, -1, 0, -2, 5, 1, -2, -3, 3, 1, -3, 0, 5, 2, -1, -5, 3, -1, -2, 2, 1, 3, -2, -3, 0, -1, 1, 3, 2, 0, 2, -5, 4, -2, -3, 1, 2, 5, -6, -3, 1, 1, 1, 2, -1, -2, 5, -1, -1, -3, 0, 2, -2, 3, -4, 0, 1, 1, 2, -1, 3, -3, 3, -2, 4, 0, -5, -2, 6, 5, -7, -4, 1, 2, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
Kevin Ryde, PARI/GP Code
EXAMPLE
The recurrence for the terms begins:
a(4) = a(1) + a(3) = 2
a(5) = -a(2) = -1
a(6) = a(2) + a(4) = 3
a(7) = -a(3) = -1
a(8) = a(3) + a(5) = 0
a(9) = -a(4) = -2
MATHEMATICA
a[1]=a[2]=a[3]=1; a[n_]:=If[EvenQ[n], a[n/2-1]+a[n/2+1], -a[(n-1)/2]]; Array[a, 80] (* Stefano Spezia, Dec 29 2022 *)
PROG
(Python)
def Seq(n): # generates n terms
seq = [1, 1, 1]
k = 0
while len(seq) < n:
seq += [seq[k] + seq[k+2]]
seq += [-1*seq[k+1]]
k += 1
return seq
(PARI) See links.
CROSSREFS
Sequence in context: A160550 A172038 A331363 * A353490 A226131 A334318
KEYWORD
sign,easy
AUTHOR
Eden Lippmann, Dec 28 2022
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 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)