OFFSET
0,3
COMMENTS
This is a variant of A363083.
LINKS
Gavin Lupo, Table of n, a(n) for n = 0..50000
Gavin Lupo, Image of the first 1000000 terms
EXAMPLE
a(0) = 1
a(1) = 1
a(2) = 2. Two 1's in the list so far. 2 > abs(1). c = 2.
a(3) = -1. One 2 in the list so far. 1 < abs(2). 1 - 2 = -1.
a(4) = 1. One -1 in the list so far. 1 = abs(-1). c = 1.
PROG
(Python)
from itertools import islice
from collections import Counter
def agen(): # generator of terms
an, c = 1, Counter([1, 1])
yield from [1, 1]
while True:
an = c[an]-an if c[an] < abs(an) else c[an]
c[an] += 1
yield an
print(list(islice(agen(), 80))) # Michael S. Branicky, May 19 2023
CROSSREFS
KEYWORD
AUTHOR
Gavin Lupo, May 18 2023
STATUS
approved