OFFSET
1,4
COMMENTS
This is a variant of A362746.
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Gavin Lupo, Image of the first 100000 terms.
EXAMPLE
a(4)=2 because a(2) and a(3) = (1, 1) appear as a contiguous pair at 2 locations: at indices (1, 2) and (2, 3).
a(7)=3 because a(5) and a(6) = (1, 2) appear as a contiguous pair at 3 locations: at indices (3, 4), (4, 5), (5, 6).
PROG
(Python)
from itertools import islice
from collections import Counter
def k(c, d): return (c, d) if c <= d else (d, c)
def agen(): # generator of terms
an, anext, c = 1, 1, Counter({(1, 1)})
while True:
yield an
an, anext = anext, c[k(an, anext)]
c[k(an, anext)] += 1
print(list(islice(agen(), 100))) # Michael S. Branicky, May 09 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, May 08 2023
STATUS
approved