OFFSET
0,8
COMMENTS
This sequence is a variation of A342585. Here we record the number of previous occurrences of the pair sum of all adjacent terms until 0 is recorded, after which the pair sum count restarts at 0. For example the terms 0,0,1,1,1 contain one pair that sums to 0 (0,0), one pair that sums to 1 (0,1), and two pairs that sum to 2 (1,1 and 1,1). See the Examples below.
After 20 million terms the largest term is a(19997365) = 512758, which counts the occurrences of pairs that sum to 15, while there are 13766 terms between zeros. It is likely the most common sum increases to arbitrarily large values as n->infinity.
LINKS
Scott R. Shannon, Image of the first 1 million terms.
EXAMPLE
a(1) = 0 as there have been no pairs so far in the sequence.
a(2) = 1 as there has been one pair that sums to 0: a(0) + a(1).
a(3) = 1 as there has been one pair that sums to 1: a(1) + a(2).
a(4) = 1 as there has been one pair that sums to 2: a(2) + a(3).
a(5) = 0 as there have been no pairs that sum to 3. The count now resets to 0.
a(6) = 1 as there has been one pair that sums to 0: a(0) + a(1).
a(7) = 3 as there have been three pairs that sum to 1: a(1) + a(2), a(4) + a(5), a(5) + a(6).
PROG
(Python)
from collections import Counter
def aupton(terms):
num, alst, inventory = 0, [0, 0], Counter([0])
for n in range(2, terms+1):
c = inventory[num]
num = 0 if c == 0 else num + 1
alst.append(c)
inventory.update([alst[-2] + alst[-1]])
return alst
print(aupton(97)) # Michael S. Branicky, Nov 05 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, Nov 05 2021
STATUS
approved