OFFSET
1,3
COMMENTS
The word 'set' means that every element is unique. For example, the set {1,1,2} contains 2 elements (not 3).
Note that we are considering sets between every pair of equal values, not just those that appear consecutively.
Two consecutive values enclose 1 term, and thus after [a(1), a(2)] = [1, 1], no consecutive equal values occur again.
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) cannot be 1 since this would create a second pair enclosing two values, [1,2,1] being an equivalent set to [1,2,1,1]. We cannot have a(4)=2 because [1,2,1] would enclose the same number of elements as [2,1,2]. So a(4)=3, which has not occurred before.
PROG
(Python)
from itertools import islice
def agen(): # generator of terms
e, a = set(), []
while True:
an, allnew = 0, False
while not allnew:
allnew, an, ndset = True, an+1, set()
for i in range(len(a)):
if an == a[i]:
nd = len(set(a[i:]))
if nd in e or nd in ndset: allnew = False; break
ndset.add(nd)
yield an; a.append(an); e |= ndset
print(list(islice(agen(), 73))) # Michael S. Branicky, Nov 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Nov 26 2024
STATUS
approved