login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A317540
a(-1) = -1, a(0) = 1, a(n) = A317539(n) - 3*(n-1) for n > 0.
1
-1, 1, 2, 0, 2, 1, -1, 0, -1, 1, -1, 0, 2, 1, 2, 0, -1, 1, -1, 0, 2, 1, -1, 0, -1, 1, 2, 0, 2, 1, 2, 0, -1, 1, -1, 0, 2, 1, -1, 0, -1, 1, -1, 0, 2, 1, 2, 0, -1, 1, 2, 0, 2, 1, -1, 0, -1, 1, 2, 0, 2, 1, 2, 0, -1, 1, -1, 0, 2, 1, -1, 0, -1, 1, -1
OFFSET
-1,3
FORMULA
a(-1) = -1, a(1) = 2, a(4n) = 1, a(4n+2) = 0, a(8n+3) = 2, a(8n+7) = -1, a(8n+1) = a(4n+1), a(1) = 2, a(8n+5) = a(4n-1), for n >= 0.
PROG
(Python)
a = [-1, 1, 2]
print(-1, -1)
print(0, 1)
print(1, 2)
n = 2
while n < 128:
if n%4 == 0:
a = a+[1]
elif n%4 == 2:
a = a+[0]
elif n%8 == 1:
a = a+[a[4*(n//8)+2]]
elif n%8 == 3:
a = a+[2]
elif n%8 == 5:
a = a+[a[4*(n//8)]]
else: # n%8 == 7
a = a+[-1]
print(n, a[n+1])
n = n+1
CROSSREFS
Cf. A317539.
Sequence in context: A060950 A039976 A287267 * A133701 A230417 A287263
KEYWORD
sign
AUTHOR
A.H.M. Smeets, Jul 30 2018
EXTENSIONS
Offset and NAME corrected by R. J. Mathar, Jun 19 2021
STATUS
approved