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
KEYWORD
sign
AUTHOR
A.H.M. Smeets, Jul 30 2018
EXTENSIONS
Offset and NAME corrected by R. J. Mathar, Jun 19 2021
STATUS
approved